OFFSET function in oracle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ¢Ð¢ý¢ö

    OFFSET function in oracle

    I want to retrieve a range of record
    such as retrieving 11th to 20th records from 10000 records
    In SQL Server, i can use the "OFFSET" function.
    so i wanna ask does Oracle provide any function similar to "OFFSET" in SQL
    SERVER?



    Thanks in advance
    Regards
    Bun


  • Christine

    #2
    Re: OFFSET function in oracle

    this may help you ....

    select * from mytable where rownum <= 20
    minus
    select * from mytable where rownum <= 10


    "¢Ð¢ý¢ö" <@.@wrote in message news:<bpc5i8$kh q10@imsp212.net vigator.com>...
    I want to retrieve a range of record
    such as retrieving 11th to 20th records from 10000 records
    In SQL Server, i can use the "OFFSET" function.
    so i wanna ask does Oracle provide any function similar to "OFFSET" in SQL
    SERVER?
    >
    >
    >
    Thanks in advance
    Regards
    Bun

    Comment

    • Guido Konsolke

      #3
      Re: OFFSET function in oracle

      "Christine" <karistom@hotma il.comwrote...
      this may help you ....
      >
      select * from mytable where rownum <= 20
      minus
      select * from mytable where rownum <= 10
      Hi Christine,

      you're kidding, right?


      Comment

      • Ethel Aardvark

        #4
        Re: OFFSET function in oracle

        Well write a little PL/SQL and do it yourself. It might look less
        efficient than SQL Server, but that's pretty much what it does
        internally.

        ETA

        "Guido Konsolke" <GK@oblivion.co mwrote in message news:<106940763 2.827289@news.t hyssen.com>...
        "Christine" <karistom@hotma il.comwrote...
        this may help you ....

        select * from mytable where rownum <= 20
        minus
        select * from mytable where rownum <= 10
        >
        Hi Christine,
        >
        you're kidding, right?

        Comment

        • Christine

          #5
          Re: OFFSET function in oracle

          "Guido Konsolke" <GK@oblivion.co mwrote in message news:<106940763 2.827289@news.t hyssen.com>...
          "Christine" <karistom@hotma il.comwrote...
          this may help you ....

          select * from mytable where rownum <= 20
          minus
          select * from mytable where rownum <= 10
          >
          Hi Christine,
          >
          you're kidding, right?
          this should work ->

          select rownum, * from mytable where rownum <= 20
          minus
          select rownum, * from mytable where rownum <= 10

          Comment

          • Christine

            #6
            Re: OFFSET function in oracle

            how come i can't delete my meg???
            THIS should work, really... ->

            select rownum, col1, col2 ... from mytable where rownum <= 20
            minus
            select rownum, col1, col2 ... from mytable where rownum <= 10


            * replace (col1, col2 ...) to whatever colname you want to select.

            Comment

            Working...