Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006
    Posts
    1

    Unanswered: DB2 Simple queries

    Hello;

    * Can anybody help me in writing a simple query to get data ranging from record # 50 to record # 75 in the query below:

    SELECT * FROM DB2ADMIN.ST_ITEM

    * Also how to generate unique id for primary key.

    Thanking you in an advance


    With Regards

    Muhammad Owais Bilal Awan

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    with temp(rid,col1,col2)
    as
    (
    select rownumber() over () ,col1,col2 from DB2ADMIN.ST_ITEM fetch first 75 rows only
    )
    select * from temp where rid between 50 and 75
    is one option

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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