how do we find every fifth record in a table

Answers were Sorted based on User's Feedback



how do we find every fifth record in a table..

Answer / satya gupt

select salary from emp e where 4=(select count(salary) from
emp where salary>e.salary

Is This Answer Correct ?    1 Yes 4 No

how do we find every fifth record in a table..

Answer / kumar.t

Table Name Is Employee
EmployeeId Is Identity field

Select * From Employee Where EmployeeId In (Select
EmployeeId From Employee Where EmployeeId%5=0)

by
Kumar.T

Is This Answer Correct ?    1 Yes 4 No

how do we find every fifth record in a table..

Answer / santhi k

Using Top N analysis....


select * from (select rownum rn, col1,col2,col3 from
tablename) where mod(rn,5)=0;

Is This Answer Correct ?    1 Yes 7 No

how do we find every fifth record in a table..

Answer / vijaya

select * from employee where employeeID % 5=0

Is This Answer Correct ?    4 Yes 13 No

Post New Answer

More SQL Server Interview Questions

What is DCL?

0 Answers  


Does order by actually change the order of the data in the tables or does it just change the output?

0 Answers  


Is natural join and equi join same?

0 Answers  


Can store procedure call by user define function in SQL server?

10 Answers   HCL,


please give me query code of unique fuction select UNIQUE (name) from emp_info Incorrect syntax near the keyword 'UNIQUE'.

1 Answers   TCS,






What are the advantages of using a stored procedure?

0 Answers  


Can Having clause be used without Group by clause?

6 Answers   CarrizalSoft Technologies, CSC, CTS,


What is an extended stored procedure? Can you instantiate a COM object by using T-SQL?

3 Answers   HCL,


How to generate create view script on an existing view?

0 Answers  


What is xml datatype?

0 Answers  


Can we join two tables without primary key?

0 Answers  


What is 'Join' and explain its various types.

0 Answers   Genpact,


Categories