Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gannamalai
Starting Member
1 Post |
Posted - 2006-12-14 : 06:10:39
|
| hai friends,i have a table called emp having 10 records.i want to display only 3rd,4th and 5th records only.there is no rowid,no primary key.please help me. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-14 : 06:17:59
|
| What is the criteria for defining 3rd, 4th and 5th record?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-14 : 06:21:03
|
| select * from <yourtablenamehere>where row_number() over (order by <somecolumnnamehere> between 3 and 5Peter LarssonHelsingborg, Sweden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-14 : 10:05:12
|
| 1 You cant do it directly2 Define those 3rd, 4th and 5th records3 Copy data to temp table that has identity column, then find records based on id4 If you use SQL Server 2005, it is very easy as suggested above5 This is really souds an Interview questionMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|