Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Return a random sample by ordering rows with the engine's random function and applying a row limit.
Use more than one sort key so ties are broken deterministically.
Use a `CASE` expression in `ORDER BY` to apply a custom sort order that is not alphabetical or numeric.
Control the order of result rows explicitly instead of relying on storage order.
A row limit without an explicit sort can return different rows over time or across engines.