Welcome to WebmasterWorld Guest from 54.221.30.139

Forum Moderators: open

Message Too Old, No Replies

MAX/MIN Question

     

wel51x

12:07 am on Jun 9, 2011 (gmt 0)



is the following illegal?

SELECT `Make` , `Model` , `Price`
FROM `inventory`
WHERE
Price = MAX( Price );

thanks to all

LifeinAsia

4:25 pm on Jun 9, 2011 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



What do you mean by "illegal?" I don't know anyone who will issue a fine for that. :)

As far as improper syntax goes, you may need to rewrite it this way:
SELECT `Make` , `Model` , `Price`
FROM `inventory`
WHERE Price = (SELECT MAX(Price) FROM `inventory`);

wel51x

7:48 am on Jun 10, 2011 (gmt 0)



Thanks.

you do actually get a $250 fine in Singapore; fortunately it's not as bad as chewing gum ;-)

LifeinAsia

4:35 pm on Jun 10, 2011 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



That's why I don't write code in Singapore. ;)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month