Results 1 to 6 of 6

Thread: SQL 123

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Posts
    8
    Hi
    I get many rows of info from a table using a SQL Select statement,I just want to put a row number by the side of each resulting row, like:
    1 jim
    2 john
    3 joe
    4 james
    5 ...
    sounds simple, but... How?
    Also any comments on how to print row numbers in DataReport would be nice.
    Thanks
    Rezania

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Why would you want to?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Posts
    8
    Hi again
    The user wants me to print it!
    Rezania

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    The problem is, it's meaningless unless the data (row number) is stored.

  5. #5
    Lively Member
    Join Date
    Jul 2000
    Location
    Stockholm, Sweden
    Posts
    83
    If your record set is ordered by something for example name. Then it could look like this
    Code:
    SELECT
     Name,
     ( SELECT
        COUNT( * )
       FROM
         tblName N2
       WHERE
         N2.Name <= N1.Name
      )
    FROM
     tblName N1
    ORDER BY
     Name
    GROUP BY
     Name
    Might not be the best but it at least pops your thread to the top.
    Yesterday, all my troubles seemed so far away...
    Help, I need somebody, Help...
    Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Posts
    8

    Thumbs up

    Hi
    After Hitting my head on the wall for so many times, I have found that I could add a column to my recordset using Shape ... Append command with the NEW option, and then fill it with row numbers in a loop.
    Thanks
    Rezania

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