>>>>> Igor Tandetnik writes:
>>>>> Ivan Shmakov <[email protected]> wrote:
>>>>> Tobias Vesterlund writes:
>>> Is it possible to get the highest value in a "limited column" when
>>> using LIMIT?
>> Sure.
>> SELECT max (id) FROM (SELECT id FROM t WHERE id > 0 LIMIT 10);
> This only works by accident. There's no requirement that the
> subselect return rows in any particular order. It can, in principle,
> choose any ten rows.
There wasn't the requirement that the query should be
unambiguous in its interpretation in the OP, either.
However, yes, almost anytime LIMIT is used, it has to be
complemented with ORDER BY for a definite result.
--
FSF associate member #7257 Coming soon: Software Freedom Day
http://mail.sf-day.org/lists/listinfo/ planning-ru (ru), sfd-discuss (en)
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users