Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone tell me how to get alternate records in SQL?

1 Answer

0 votes
by (119k points)
edited by

You can use the following query to get the alternate even-numbered records in SQL:

 

SELECT *

FROM table_name

WHERE column_name % 2 = 0

You can use the following query to get the alternate odd-numbered records in SQL:

SELECT *

FROM table_name

WHERE column_name % 2 = 1

If you are interested in SQL, then take up this SQL certification online course by Intellipaat that offers instructor-led training, certification, and job assistance.

Related questions

0 votes
1 answer
asked May 6, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
asked Apr 20, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer

Browse Categories

...