Forum

How can you fetch a...
 
Share:
Notifications
Clear all

How can you fetch alternate records from a table?


kumar BI
Posts: 12
 kumar BI
Topic starter
(@kumar BI)
Joined: 2 years ago

Table alternate records

1 Reply
Ram DBA
Posts: 47
 Ram DBA
(@Ram DBA)
Joined: 2 years 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



Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: