0 votes
1 view
in SQL by (34.6k points)

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

1 Answer

0 votes
by (72.1k points)

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 program by Intellipaat that offers instructor-led training, certification, and job assistance.

Related questions

0 votes
1 answer
asked May 6 in SQL by Sudhir_1997 (34.6k points)
0 votes
1 answer
0 votes
1 answer
asked Apr 20 in SQL by Sudhir_1997 (34.6k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...