"Richard Broersma" <[EMAIL PROTECTED]> writes:
> I looked for ROW_NUMBER in the developer docs. I could only find it
> under the KEY WORDS list. I guess they haven't put in a good example
> yet.
> I saw this recently demonstrated at PgWest by Dave Fetter. He
> illustrated several example of how
On Wed, Oct 15, 2008 at 10:21 PM, A. Kretschmer
<[EMAIL PROTECTED]> wrote:
>
> Can you show an example for 8.4?
I looked for ROW_NUMBER in the developer docs. I could only find it
under the KEY WORDS list. I guess they haven't put in a good example
yet.
I saw this recently demonstrated at PgWes
David Rowley wrote:
It's not 100% certain that it will be possible for 8.4, probably though.
select row_number() over (order by employeeid) as nrow,* from employee order
by employeeid
That makes sense, thanks. So extracting rate-of-change etc. would be a
join on two subselects followed by a
Andreas Kretschmer wrote:
> Can you show an example for 8.4?
It's not 100% certain that it will be possible for 8.4, probably though.
select row_number() over (order by employeeid) as nrow,* from employee order
by employeeid
It's important to have both the order bys
There is more information on
am Wed, dem 15.10.2008, um 12:23:42 -0700 mailte Richard Broersma folgendes:
> On Wed, Oct 15, 2008 at 12:08 PM, ries van Twisk <[EMAIL PROTECTED]> wrote:
> > May be this function can help :
> >
> > http://www.postgresql.org/docs/8.3/static/functions-srf.html
>
> Using generate series won't numbe
D. Dante Lorenso wrote:
PERL can remember variables in your session. Here's a function I wrote
that sets a "global" variable in PL/PERL:
Perl can do anything- that's cheating :-)
Actually, I use Perl heavily but the advantage of being able to do the
sort of analysis being discussed in a sin
Mark Morgan Lloyd wrote:
Is there an easy way to assign a sequential number, possibly based on an
arbitrary minimum (typically 0 or 1) to each row of an ordered result
set, or do I have to work with explicit sequences?
I need to do quite a lot of maths on successive rows, extracting numeric
a
Thanks everybody- I'm watching with a lot of interest. I was worried
that I was asking something stupid with an obvious answer...
ries van Twisk wrote:
May be this function can help :
http://www.postgresql.org/docs/8.3/static/functions-srf.html
Thanks, that's already turning out to be useful
On Wed, Oct 15, 2008 at 12:32 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote:
> Can't you put the query into a subselect with an offset 0 and join to
> that to get the generate_series to work correctly?
I've never heard of doing it that way, but I'm very interestes in
seeing how it is done. This i
On Wed, Oct 15, 2008 at 1:23 PM, Richard Broersma
<[EMAIL PROTECTED]> wrote:
> On Wed, Oct 15, 2008 at 12:08 PM, ries van Twisk <[EMAIL PROTECTED]> wrote:
>> May be this function can help :
>>
>> http://www.postgresql.org/docs/8.3/static/functions-srf.html
>
> Using generate series won't number the
On Wed, Oct 15, 2008 at 12:08 PM, ries van Twisk <[EMAIL PROTECTED]> wrote:
> May be this function can help :
>
> http://www.postgresql.org/docs/8.3/static/functions-srf.html
Using generate series won't number the rows that way that you would
want. You basically will end up with a cross join betw
May be this function can help :
http://www.postgresql.org/docs/8.3/static/functions-srf.html
Ries
On Oct 15, 2008, at 1:44 PM, Mark Morgan Lloyd wrote:
Is there an easy way to assign a sequential number, possibly based
on an arbitrary minimum (typically 0 or 1) to each row of an ordered
res
Volkan,
> CREATE SEQUENCE document_docorder_seq START 1;
>
> UPDATE document
> SET docorder = T.docorder
> FROM (SELECT nextval('document_docorder_seq') AS docorder, docdate
> FROM document
> ORDER BY docdate) AS T
> WHERE document.docdate = T.docdate;
>
> DROP SEQUENCE documen
On Wed, 2 Apr 2008, "Andrus" <[EMAIL PROTECTED]> writes:
> create Document ( docdate date, docorder integer )
>
> I need update docorder column with numbers 1,2 in docdate date order
> Something like
>
> i = 1;
> UPDATE Document SET docorder = i++
> ORDER BY docdate;
CREATE SEQUENCE document_doc
In article <[EMAIL PROTECTED]>,
"Andrus" <[EMAIL PROTECTED]> writes:
> I have table
> create Document ( docdate date, docorder integer )
> I need update docorder column with numbers 1,2 in docdate date order
> Something like
> i = 1;
> UPDATE Document SET docorder = i++
> ORDER BY docdate;
>
Andrus wrote:
I have table
create Document ( docdate date, docorder integer )
I need update docorder column with numbers 1,2 in docdate date order
Something like
i = 1;
UPDATE Document SET docorder = i++
ORDER BY docdate;
How to do this is PostgreSQL 8.2 ?
ALTER TABLE DROP COLUMN docord
16 matches
Mail list logo