Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Incremental counter colum in SQL statement
Sat, Nov 15 2008 5:38 AMPermanent Link

"Al Vas"
Hi,

Is it possible to assign a recordno column in a select statement?  Basically
I want to have each record count a unique identifier beginning at 1, so
record one has a column value of 1, record two has 2, etc etc.

Sorry if its a dumb question, just cant find a way to do it.

DBISAM V3.30

Thanks

Alex
Sat, Nov 15 2008 7:06 AMPermanent Link

"Malcolm"
Al Vas wrote:

> Hi,
>
> Is it possible to assign a recordno column in a select statement?  Basically I want to have each record count a unique identifier beginning at 1, so record one has a column value of 1, record two has 2, etc etc.
>
> Sorry if its a dumb question, just cant find a way to do it.
>
> DBISAM V3.30
>
> Thanks
>
> Alex

Check out RUNSUM()

--
Sat, Nov 15 2008 12:28 PMPermanent Link

"Robert"

"Al Vas" <noreply@noreply.com> wrote in message
news:B0D61396-66A2-4ECE-AE4A-BCB11F1A0A6A@news.elevatesoft.com...
> Hi,
>
> Is it possible to assign a recordno column in a select statement?
> Basically I want to have each record count a unique identifier beginning
> at 1, so record one has a column value of 1, record two has 2, etc etc.
>
> Sorry if its a dumb question, just cant find a way to do it.
>

The way I usually do this is to select INTO a memory table, then add an
autoinc field to the memory table. Use an ORDER BY in the select if you need
the numbers assigned in a specific order.

Robert

> DBISAM V3.30
>
> Thanks
>
> Alex

Image