• +91 9723535972
  • info@interviewmaterial.com

DBMS Interview Questions and Answers

Question - How can you get the alternate records from the table in the SQL?

Answer -

If you want to fetch the odd numbers then the following query can be used:

SELECT EmpId from (SELECT rowno,EmpId from Emp) WHERE mod(rowno,2)=1;
If you want to fetch the even numbers, then the following query can be used:

SELECT EmpId from (SELECT rowno,EmpId from Emp) WHERE mod(rowno,2)=0;

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners