From: mikeo <mikeo@spectrumtelecorp.com>
To: Ed Loehr <eloehr@austin.rr.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] oracle rownum equivalent?
Date: Wed, 07 Jun 2000 10:14:23 -0400
Message-ID: <3.0.1.32.20000607101423.00930360@pop.spectrumtelecorp.com> (raw)
In-Reply-To: <393E4E29.649C3C5@austin.rr.com>
References: <3.0.1.32.20000607082428.00925870@pop.spectrumtelecorp.com>
thanks for the response. oid is equivalent to oracle rowid.
rownum can be used similar to the limit option of select in postgres
but in oracle it can also be used in a where clause, or as an assigment
in an update statement for instance.
eg: update ctmaster set bsc_id = mod(rownum,3) +1;
this gives me a way to assign streams to rows in a load balanced manner
on the fly, for example. i use it in other more involved ways than this
also. i cannot do this with limit. i could do this with sequence with
a max value but i'd have to define a sequence each time i wanted to do
something "on the fly" or for what ifs.
what i'm also interested in is how to find reference to these type of
pseudo-columns, even just the names of them, if they're listed somewhere.
thanks again,
mikeo
At 08:29 AM 6/7/00 -0500, Ed Loehr wrote:
>mikeo wrote:
>>
>> is there an equivalent to rownum in oracle?
>>
>> also, where can one find reference to "hidden columns"
>> such as OID or, as in oracle, rownum?
>
>oid is the equivalent. not sure documentation exists for these...
>
>Regards,
>Ed Loehr
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: mikeo@spectrumtelecorp.com, eloehr@austin.rr.com, pgsql-general@postgresql.org
Subject: Re: [SQL] oracle rownum equivalent?
In-Reply-To: <3.0.1.32.20000607101423.00930360@pop.spectrumtelecorp.com>
References: <3.0.1.32.20000607082428.00925870@pop.spectrumtelecorp.com> <3.0.1.32.20000607101423.00930360@pop.spectrumtelecorp.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox