Forum

How can you fetch a...
 
Notifications
Clear all

How can you fetch alternate records from a table?


kumar BI
Posts: 12
 kumar BI
Topic starter
(@kumar BI)
Joined: 1 year ago

Table alternate records

1 Reply
Ram DBA
Posts: 47
 Ram DBA
(@Ram DBA)
Joined: 1 year ago

You can fetch alternate records i.e both odd and even row numbers.

For example-

To display even numbers, use the following command:

Select student from (Select row, students from student) where mod(row,2)=0

To display odd numbers, use the following command

Select student from (Select row, students from student) where mod(row,2)=1

Reply
Share: