Thread: serial number in output

serial number in output

From
"alessandra de gregorio"
Date:
Hi,

What function should I use to get a serial number, together with my results,
from a query?

Ex. Of output I want:

1    ooo    pp    ij
2    hou    joo    iu
3    bhi    ft    yh

Basically, I would like to have one column with integers, from 1 onwards, no
matter how many tables I join in, or the data that I get back.

Thanks



Re: serial number in output

From
hubert depesz lubaczewski
Date:
On 10/28/05, alessandra de gregorio <adegregorio@fgscapital.com> wrote:
What function should I use to get a serial number, together with my results,
from a query?
Ex. Of output I want:
1       ooo     pp      ij
2       hou     joo     iu
3       bhi     ft      yh
Basically, I would like to have one column with integers, from 1 onwards, no
matter how many tables I join in, or the data that I get back.

first of all - this is job for client program to do the numbering, but if you really insist on having this in database (why?) then just use temporary sequence.

depesz