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

What is the federation in sql azure?

95


What are database states in ms sql server?

1169


What does null mean?

978


What is the use of custom fields in report?

991


Tell me extended events in sql server 2008?

989


What is log in sql server?

1139


Tell me about builtinadministrator?

988


What is openxml in sql server?

1159


How optimize sql query with multiple joins in sql server?

888


What does it mean if @@cursor_row returns a negative number?

982


Which are the important points to note when multilanguage data is stored in a table?

987


Explain why variables called the most powerful component of ssis?

1079


What changes in the front end code is needed if mirroring is implemented for the high availability? : sql server database administration

1008


Which are the two editions in which SQL Azure database available?

119


What are the steps you can take to avoid “deadlocks”?

970