Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to get 25th row in any table in sqlserver can u tell me
syntax

Answer Posted / anand k

For Ex. We are Using State Table for this scenario.

Records In State Table is (Total 50 Rec)
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
--------

Now we are Selecting 25th record from the state table.

SELECT STA.*
FROM [State] STA,
(SELECT StateName,ROW_NUMBER() OVER (ORDER BY StateName)
ROWNO FROM [State] ) ROW
WHERE ROW.ROWNO = 25
AND ROW.StateNAme = STA.StateName
ORDER BY StateName

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain throw statement in sql server 2008?

998


Detail about the hardware which is supported by SQL server?

1063


How to apply filtering criteria at group level with the having clause in ms sql server?

1002


what changed between the previous version of sql server and the current version? : Sql server database administration

1014


Explain partitioned view?

1081


what is memory-optimized nonclustered indexes

1016


You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?

990


Can a cursor be updated? If yes, how you can protect which columns are updated?

1111


What are the difference between primary keys and foreign keys?

966


What are the differences between char and varchar in ms sql server?

1066


What happens when unicode strings concatenate with non-unicode strings?

1097


What is a constant or literal in ms sql server?

1048


How to Update from select query in sql server?

1062


Where are sql server user names and passwords stored in sql server?

1093


Can primary key be a foreign key?

1059