Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get top two occurrence of each city based on timestamp which gets populated in the table.
In my table every time few city names gets poopulated with some data. i want to prepare 1 query which will retrieve only two occurrence of each city and then it will display other city.

example :

cityname column1 column2 last_update_date
delhi E F 20/01/2017 12:05
agra A B 20/01/2017 12:04
agra B C 20/01/2017 12:03
agra c D 20/01/2017 12:02
agra D E 20/01/2017 12:01

o/p should be:

cityname column1 column2 last_update_date
delhi E F 20/01/2017 12:05
agra A B 20/01/2017 12:04
agra B C 20/01/2017 12:03

What I have tried:

i can't think what i can use please suggest
Posted
Updated 23-Sep-17 4:55am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900