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

Answers were Sorted based on User's Feedback



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

Answer / sujitha

For Example TableName: Employee. Employee Have The
Following Fields.
Emp_No ( Identity Value)
Emp_Name
Designation



Select Top 1 * From Employee Where Emp_No Not in(Select
Top 24 Emp_No From Employee)

Is This Answer Correct ?    13 Yes 2 No

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

Answer / 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

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

Answer / pradyumna

set rowcount 25
declare @temptable table
(id int identity(1,1),itemid int)
insert @temptable
select itemid from tbl123

select * from tbl123 where itemid=(select itemid from
@temptable where id=25)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / nagaraju jella

select *
from securitytest_64.userroles u
where rowid =
(select max(rowid) from securitytest_64.userroles u
where rownum < 26)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / svreddy

select *from emp a where 25=(select count(distinct(eno))from emp b where a.eno>=b.eno

Is This Answer Correct ?    0 Yes 0 No

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

Answer / manub22

Check here how to get 2nd of nth highest record from a table: http://sqlwithmanoj.com/2014/01/05/sql-trivia-find-second-or-nth-highest-salary-or-marks/

Is This Answer Correct ?    0 Yes 0 No

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

Answer / a.alagu ganesh

We create index colomn in that table . use that index
coloum we take the 25th row of that table .

Example

SELECT * FROM table1 WHERE index_coloumn = 25

Is This Answer Correct ?    4 Yes 8 No

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

Answer / venkat

suppose the table x having a column with name empid

set rowcount 25
select * from x where empid not in (select top 24 empid
from x)

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More SQL Server Interview Questions

Different Types of Functions ?

2 Answers   Satyam,


How do I install only the client tools of sql server 2000?

0 Answers  


How to sort the query output with order by clauses in ms sql server?

0 Answers  


what is procedure in sql?

2 Answers   Millennium, SQL,


I have a huge amount of data which is displayed in a report. The data is viewed every day. Every day the data is displayed in 30 secs but suddenly today it is giving an timeout message today. Data has not been changed. The situation is same as yesterday. What might be the reason??? Please Answer.

4 Answers   Satyam,


What is the syntax to execute the sys.dm_db_missing_index_details?

0 Answers  


Which joins are sql server default?

0 Answers  


What is row by row processing ?

2 Answers  


hi ..i am working as a sql dba.....now i want to learn more about t-sql..... is it possible to learn online.... plz refer any site ..thankq

0 Answers   IBM,


What are difference between Cluster index and Non-Cluster index?

0 Answers   QuestPond,


Why do we use stored procedures in sql server?

0 Answers  


Can you tell me the difference between DELETE & TRUNCATE commands?

15 Answers  


Categories