Hi,

I'm want to get the max value out of a certain column in a table.

Table t has a column named id, which ranges from 0 to 99.

If I do SELECT max(id) FROM t; it will return 99.
If I do SELECT id FROM t WHERE id > 0 LIMIT 10; it will return 
1,2,3,4,5,6,7,8,9,10
But If I do SELECT max(id) FROM t WHERE id > 0 LIMIT 10; it will return 99.

My logic, which may be flawed in this case, tells me the third SELECT should 
return 10 and not 99.

Is it possible to get the highest value in a "limited column" when using LIMIT?

Regards,
Tobias

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to