Sample Header Ad - 728x90

SQL order by query results in any arbitrary (but reproducible) manner

3 votes
2 answers
1970 views
For testing purposes I need to get some data from a set of database tables in any arbitrary (but reproducible) order. The idea being that I can later compare two runs using a textual diff tool. Is there an idiom for that? E.g. I can obviously do a: SELECT * FROM table_with_N_columns ORDER BY column_1, ... , column_N I am just asking if there is an idiomatic way to achieve the same effect (for my purposes) without bothering to list every column in the ORDER BY clause. Any ordering will do so long as it is reproducible with subsequent runs of the query.
Asked by Marcus Junius Brutus (3409 rep)
Sep 6, 2014, 12:55 PM
Last activity: Jun 9, 2024, 11:31 PM