Selecting alternate records
Use this tip to find alternate or even/odd records.
To find alternate or even/odd records, use this query:
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
select * from (select emp.* ,rownum k from emp ) where mod(k,2)=0; select * from (select emp.* ,rownum k from emp ) where mod(k,2)<>0;
By using above query, you can get alernative rows.
For More Information
- What do you think about this tip? E-mail us at [email protected] with your feedback.
- The Best SQL Web Links: tips, tutorials, scripts, and more.
- The Best Web Links on Queries.
- Have an SQL tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
- Ask your technical SQL questions--or help out your peers by answering them--in our live discussion forums.
- Check out our Ask the Experts feature: Our SQL gurus are waiting to answer your toughest questions.