To find alternate or even/odd records, use this query:
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 editor@searchDatabase.com 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.