Hi friends,
What will be the query to Display Odd/ Even number of records in oracle
Thanks
Hi friends,
What will be the query to Display Odd/ Even number of records in oracle
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 25, 2011, 9:18 PM EST
Welcome to c-sharpcorner community.
Here is your query
Even number of records:
select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
Odd number of records:
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
Thanks
If this post helps you mark it as answer