4 ms·
You have to keep in mind that unspecified elements of SQL are not guaranteed to be random. There is no situation in which the two queries you supplied, executed
by goodside 16y ago
You have to keep in mind that unspecified elements of SQL are not guaranteed to be random. There is no situation in which the two queries you supplied, executed sequentially as you "expect", would be guaranteed to produce different results. For any possible set X of 20-or-fewer Davids who are 29 or older, there exists a set of Y of 20 or fewer Davids of unspecified age such that X is the subset of Y obtained by filtering out the Davids in Y who are younger than 29. If your query allows this result, the DBMS is permitted to return it if it deems it more efficient.
You cannot assume anything about your result sets. It's best to just pretend every database functions something like the Monkey's Paw: it will grant your wish to the letter, but always in the most horrifying manner that your wish permits.