views:

50

answers:

2

Is is poslbe too get the highest value from a row?

IE. I have 3 days as columns with a timestamp value, can i get the highest value out?

+1  A: 
SELECT MAX(column1,column2,cloumn3) FROM ...
osgx
I tested this and it doesn't work. Furthermore the MySQL docs on MAX() make no mention of comma delimited list functionality -- http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_max
Asaph
`MAX` is an aggregate in MySQL (http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html) - that syntax works on SQLite, not MySQL.
OMG Ponies
+3  A: 

GREATEST() might be what you want:

http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#function_greatest

dbemerlin
Thnx you, right what i needed
A-R