From: | Andreas Kretschmer <akretschmer(at)spamfence(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: serial in output |
Date: | 2005-11-04 12:48:52 |
Message-ID: | 20051104124852.GA3218@kaufbach.delug.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
alessandra de gregorio <adegregorio(at)fgscapital(dot)com> schrieb:
> 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.
Create a sequence and then "select nextval('your_sequence'), * from foo;"
HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
From | Date | Subject | |
---|---|---|---|
Next Message | Harald Fuchs | 2005-11-04 14:03:01 | Re: serial in output |
Previous Message | Richard Huxton | 2005-11-04 08:12:59 | Re: JOIN condition confusion |