Thursday 28 February 2013

How to Select Major Cities on Top in SQL?

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



No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...