Search Postgresql Archives

Re: sql questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zitat von hamann.w@xxxxxxxxxxx:

a) I am running some select query
select ... order by ....
Now, I would like to preserver the ordering through further processing by adding a sequence number
Of course I can do:
create temp sequence mseq;
select xx.*, nextval('mseq') as ord from (select ... order by ....) xx;
drop sequence mseq;
Is there a simpler way (avoiding the create/drop parts)

Can't you just do the ordering at the end of the processing? Maybe you need to drag along the order by columns and just dump them at the very end if applicable.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Attachment: bintUfp4rQQlN.bin
Description: PGP Public Key


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux