DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: sql query

  1. #1
    Join Date
    Feb 2005
    Posts
    10

    sql query

    Hi ,

    I am trying to get the following output in a select query

    1
    1
    1
    1
    2
    2
    2
    2
    3
    3
    3
    3

    like wise for every four records the counts need to tbe increased.

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    I need you to put assisted by Gandolf989 and my dog's
    picture on your homework assignment.

    Welcome to the wonderful world of MOD!!!

    Code:
    SYS@rdbadb01 AS SYSDBA> select mynum from (
      2  select MOD(rownum, 3)+1 mynum
      3  from all_objects where rownum<13 )
      4  order by 1;
    
         MYNUM
    ----------
             1
             1
             1
             1
             2
             2
             2
             2
             3
             3
             3
             3
    
    12 rows selected.
    
    Elapsed: 00:00:00.17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width