Created
September 13, 2017 21:54
-
-
Save 04pallav/4d99c4b94a5a4ff9bc3dacf76c0ca827 to your computer and use it in GitHub Desktop.
LENGTH OF CHARACTER, ORDER BY AND LIMIT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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