TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
divya
NA
186
111.6k
How to select Top 2 rows of each id in a table??
Aug 8 2013 2:35 AM
Id
NewPropertyId
PropertyType
Area
Price
1
2543712
Appartments
1500
60 lakhs
2
2543712
Appartments
1800
20 Lakhs
3
2543712
Appartments
2200
25 lakhs
4
444763
Commertial shops
1300
60 lakhs
5
444763
Commertial Shops
1500
50 Lakhs
6
444763
Commertial Shops
1800
60 lakhs
7
444763
Commertial Shops
2000
30 Lakhs
8
444763
Commertial Shops
2400
55 Lakhs
Here How can I select Top two rows of each NewPropertyId in the above table .I need output Like this.
1 2543712 Appartments 1500 60lakhs
2 2543712 Appartments 1800 20 lakhs
4 444763 CommertialShops 1300 60 Lakhs
5 444763 CommertialShops 1500 50 Lakhs
Regards
Divya
Reply
Answers (
2
)
Select Find Nth Highest Salary Record In Sql Server
How to do table partioning in sql server 2008 r2