Skip to content

Instantly share code, notes, and snippets.

@04pallav
Created September 13, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 04pallav/4d99c4b94a5a4ff9bc3dacf76c0ca827 to your computer and use it in GitHub Desktop.
Save 04pallav/4d99c4b94a5a4ff9bc3dacf76c0ca827 to your computer and use it in GitHub Desktop.
LENGTH OF CHARACTER, ORDER BY AND LIMIT
SELECT CITY,LENGTH(CITY) FROM STATION ORDER BY CITY ASC LIMIT 1;
SELECT * FROM CUSTOMERS
ORDER BY (CASE ADDRESS
WHEN 'DELHI' THEN 1
WHEN 'BHOPAL' THEN 2
WHEN 'KOTA' THEN 3
WHEN 'AHMADABAD' THEN 4
WHEN 'MP' THEN 5
ELSE 100 END) ASC, ADDRESS DESC; ###ORDERING IN A PARTICULAR ORDER
select * from nobel where winner like 'Sir%' order by yr desc,winner asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment