How to Select Metro Cities on Top in SQL?
In this article, we are going to see how to select the cities on top of the list in SQL i.e. metro cities like, Delhi, Mumbai, Kolkata, Chennai Should come on top rest of the cities come below. Here is the query
Select City_Name from City Where City_Name in ('Delhi','Mumbai','Kolkata','Chennai')
union all
Select City_Name from City Where City_Name not in ('Delhi','Mumbai','Kolkata','Chennai')
Below Image shows the result set
In this article, we are going to see how to select the cities on top of the list in SQL i.e. metro cities like, Delhi, Mumbai, Kolkata, Chennai Should come on top rest of the cities come below. Here is the query
Select City_Name from City Where City_Name in ('Delhi','Mumbai','Kolkata','Chennai')
union all
Select City_Name from City Where City_Name not in ('Delhi','Mumbai','Kolkata','Chennai')
Below Image shows the result set
No comments:
Post a Comment