Sql counter??

Results 1 to 3 of 3

Thread: Sql counter??

  1. #1
    Join Date
    Dec 1969

    Default Sql counter??

    Hi All!<BR><BR>I have a database and am trying to return a specific field with the row number of the record from the table.<BR><BR>For example if my database table contained:<BR><BR>abc<BR>def<BR>ghi<BR>jkl<BR><BR> what i want to return in my select query is:<BR><BR>abc 1<BR>def 2<BR>ghi 3<BR>jkl 4<BR><BR>... there will be no where clause or anything, surely this is straight forward right... well not to me...!!!<BR><BR>Thanks<BR>Steve

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Tell us why?

    That IMHO is a stupid requirment...what is it you want to get that you need a recordset with that data.<BR><BR><BR>The only thing i can give you is just select the data and then use recordset properties to give you the record number - AbsolutePosition

  3. #3
    Join Date
    Dec 1969

    Default RE: Sql counter??

    If you are using Oracle use the Rownum pseudo column. If you using some other database, after fetching the records in the recordset, use the Recordset.AbsolutePostion to return the current record number. This may not give the exact location of the record in the database, but it will be based on the output of the query you make.<BR>Hope you got what you need..... Best of Luck.

Posting Permissions

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