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 |
|
soori457
Yak Posting Veteran
85 Posts |
Posted - 2009-04-03 : 01:39:08
|
| This is my table data EmpId EmpNamerow1 101 sureshrow2 102 kumarrow3 103 diliprow4 151 sandeeprow5 161 kiranNow I need to retrieve data for a particular row numberlike row1 or row2Suresh Kumar |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-04-03 : 01:43:46
|
| if it is basis on ur empid then ,,,,,just select top 2 from urtable order by empidor u can also do this..with ashish as(select *,row_number () over(order by empid) as RN from urtable)select from ashish where RN < 3May BE like This..Thanks |
 |
|
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2009-04-03 : 02:02:41
|
| hi soori give some sample output based on ur condition... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-03 : 03:02:00
|
| If you use SQL Server 2005/2008, use ashishashish's suggestionMadhivananFailing to plan is Planning to fail |
 |
|
|
soori457
Yak Posting Veteran
85 Posts |
Posted - 2009-04-03 : 03:07:51
|
| Hai AshishThanks for ur queryIt is very helpful for meSuresh Kumar |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-04-03 : 04:45:51
|
| Thanks and Happy Quering.. |
 |
|
|
|
|
|