how do we find every fifth record in a table

Answer Posted / vicky

Assuming there are 3 columns in the table emp1

select id, name ,salary from ( select id,name ,salary,
mod(rownum,5) as r from emp1) where r=0

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to delete duplicate rows from table except one?

543


Is INSTEAD OF trigger directly applicable to Table ?

571


Explain different types of self contained sub query?

543


How to query multiple tables jointly?

556


Is there any difference between primary key and unique with the not null condition?

529






Suppose you want to implement the one-to-many relationships while designing tables. How would you do it?

499


What do you mean by tablesample?

639


Write an sql query to find first weekday of the month?

480


how you can list all the tables in a database?

522


How to get @@error and @@rowcount at the same time?

567


How do I find my localdb version?

491


What are the differences between triggers and stored procedures?

533


what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration

534


Explain the dbcc pintable command when would you use it?

505


How to create nested stored procedure?

541