-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Description
If you want to order your result by 1 category at the top you can do something like
SELECT * FROM users ORDER BY country = 'US' DESCor even
SELECT * FROM users ORDER BY country IN ('US', 'CA') DESCIt would be nice if we could specify these in an object like so
sql.select().from('users').orderBy({ country: 'US' });
sql.select().from('users').orderBy({ country: ['US', 'CA'] });(There also doesn't seem to be a way to describe DESC or ASC)
now I have to do
sql.select().from('users').orderBy('country = "US" DESC');
sql.select().from('users').orderBy('country IN ("US", "CA") DESC');Metadata
Metadata
Assignees
Labels
No labels