Forum

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

How can you fetch alternate records from a table?


Posts: 12
Guest
Topic starter
(@kumar BI)
Active Member
Joined: 4 years ago

Table alternate records

1 Reply
Posts: 47
Guest
(@Ram DBA)
Eminent Member
Joined: 4 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

Self Learning Video Tutorials - Software Course

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: