look at the function GREATEST
On Sun, Dec 14, 2008 at 4:50 PM, Stephen Hait sh...@mindspring.com wrote:
On Sat, Dec 13, 2008 at 10:26 PM, Jim McAtee jmca...@mediaodyssey.comwrote:
The max price may not be present and is set to zero when that's the case,
so data might look like:
1 5
5 0
3
I don't have MySQL installed, but this is how I'd do it in MSSQL (and
I don't see why it wouldn't work for you...):
SELECT
*,
OrderValue = CASE WHEN MinPrice MaxPrice THEN MinPrice ELSE
MaxPrice END
FROM
mytable
ORDER BY
OrderValue DESC
Seb
Seb Duggan
Web
On Sat, Dec 13, 2008 at 10:26 PM, Jim McAtee jmca...@mediaodyssey.comwrote:
The max price may not be present and is set to zero when that's the case,
so data might look like:
1 5
5 0
3 10
8 0
6 0
I want to order by the larger of the two column values
ORDER BY Max(minprice, maxprice)
I have a table with two columns containing min and max values
minprice INT
maxprice INT
The max price may not be present and is set to zero when that's the case,
so data might look like:
1 5
5 0
3 10
8 0
6 0
I want to order by the larger of the two column values
ORDER BY Max(minprice,
haven't tried
that yet.
~Brad
- Original Message -
From: Jim McAtee jmca...@mediaodyssey.com
To: cf-talk cf-talk@houseoffusion.com
Sent: Saturday, December 13, 2008 9:26 PM
Subject: Is there a non-aggregate Max() function in MySQL?
I have a table with two columns containing min and max
5 matches
Mail list logo