RE: Pretty Simple MAX Value question...

2002-05-09 Thread Max Anderson
SELECT MAX(id) FROM (SELECT MAX(id) FROM table WHERE DATE = '20020509' LIMIT 100) Dunno if this works in MySQL, I can't access a MySQL database from here to test it out. This should return the value that you want but I would be interested to learn the usefulness of

RE: Pretty Simple MAX Value question...

2002-05-09 Thread Gurhan Ozen
Hi Andrew, IT is working as it is supposed to , MAX() only returns one row with the highest value. IF you wanna get 100 highest values, just order the rows by id and limit the result set to 100. SELECT id FROM table WHERE DATE = '20020509' ORDER BY id LIMIT 100 Gurhan -Original

Re: Pretty Simple MAX Value question...

2002-05-09 Thread Paul DuBois
At 16:30 -0400 5/9/02, Andrew Kuebler wrote: I want to select say 100 of 1,000 records and get the highest value for id in that query, however the MAX command always gives me the MAX for the whole table, not just my query. Here's my expression: SELECT MAX(id) FROM table WHERE DATE = '20020509'

Re: Pretty Simple MAX Value question...

2002-05-09 Thread Arjen Lentz
At 16:30 -0400 5/9/02, Andrew Kuebler wrote: I want to select say 100 of 1,000 records and get the highest value for id in that query, however the MAX command always gives me the MAX for the whole table, not just my query. Here's my expression: SELECT MAX(id) FROM table WHERE DATE =