Forum

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

How can you fetch alternate records from a table?

2 Posts
1 Users
0 Reactions
1,506 Views
Posts: 12
Topic starter
(@kumar BI)
Joined: 6 years ago

Table alternate records


1 Reply
Posts: 46
(@Ram DBA)
Joined: 6 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: