select greatest(col1,col2,col3) from
(select max(col1) as col1 from t) a,
(select max(col2) as col2 from t) b,
(select max(col3) as col3 from t) c

----- Original Message ----- From: "KLEIN Stéphane" <[EMAIL PROTECTED]>
To: "Ricardas S" <[EMAIL PROTECTED]>
Cc: <mysql@lists.mysql.com>
Sent: Wednesday, June 13, 2007 10:00
Subject: Re: How can I do something like this "SELECT MAX(col1, col2, col3) FROM 
mytable ORDER BY MAX(col1, col2, col3);" ?


2007/6/13, Ricardas S <[EMAIL PROTECTED]>:
Ops, small mistake, shoud be

MAX((col1*(MAX_VALUE_OF_COL2+1)+col2)*(MAX_VALUE_OF_COL3+1)+col3)


Sorry, my question is ashamed.

Example, I've this row :

Col1 | Col2 | Col3
1      |   5   |   8
6      |   2   |   4
12    |   13   |  6

After my query, I would like this :

Max_value_col
6
8
13

Well, I would like MAX value of cols of one row, not on all the column.

I don't know if my explication it more clear.

Stephane

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to