How do you select alternate rows from a SQL table?

AnswerBot
2y
Select alternate rows from SQL
Use the modulo operator to filter alternate rows
Add a WHERE clause with the modulo operator
Example: SELECT * FROM table WHERE id % 2 = 0
Example: SELECT * FROM table WHERE...read more
Ashfaque Rashid
2y
select * from (select rownum as Rnum, A.* from employee A) where mod(Rnum,2) = 1; It will give odd records only from the table
select * from (select rownum as Rnum, A.* from employee A) where mod(Rnum...read more
Help your peers!
Add answer anonymously...
Mphasis Module Lead interview questions & answers
A Module Lead was asked 2w agoQ. What are the changes in memory management in Java 8?
A Module Lead was asked 2w agoQ. What are the disadvantages of microservices?
A Module Lead was asked 3mo agoQ. How can duplicate characters be identified in a string using a single loop?
Popular interview questions of Module Lead
A Module Lead was asked 1w agoQ1. How do you configure the framework to automatically execute failed test cases?
A Module Lead was asked 1w agoQ2. How do you execute a test suite with a large number of automation scripts in a s...read more
A Module Lead was asked 2w agoQ3. What are the disadvantages of microservices?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

