locked
How can i get the odd rows in my query form a table ? RRS feed

  • Question

  • User1253338400 posted

    I am trying to get the odd rows and have the following so far:

    Select * from

          (Select rownum as rowNum, ord.* from Orders ord)   ????? <--- I know something goes here in regards to mod but unsure 

    Thanks

    Thursday, June 11, 2020 11:06 PM

Answers

  • User452040443 posted

    Hi,

    Try:

    where rownum % 2 = 1

    Hope this help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 12, 2020 1:35 AM

All replies

  • User452040443 posted

    Hi,

    Try:

    where rownum % 2 = 1

    Hope this help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 12, 2020 1:35 AM
  • User1253338400 posted

    Hi ,

    thankyou , you made it look so simple . works perfectly.

    Friday, June 12, 2020 1:48 AM