My wishlist for SQL: the UNTIL clauseFri, Jan 22, 2010 in Databases
I’d like an UNTIL clause, please. I’d use it sort of like LIMIT in MySQL and PostgreSQL, except that it would define when to stop
returning looking for rows, instead of defining how many to return. Example:
SELECT * FROM users ORDER BY user_id UNTIL user_id >= 100;
That would select users up to and including user 99. Ideally the clause could accept any boolean predicate, including subqueries. I’ll hold my breath and wait for this wish to come true now.
I'm Baron Schwartz, the founder and CEO of VividCortex. I am the author of High Performance MySQL and many open-source tools for performance analysis, monitoring, and system administration. I contribute to various database communities such as Oracle, PostgreSQL, Redis and MongoDB.