Re: Is it possible to make the order of output the same as the order of input parameters? - Mailing list pgsql-general

From A. Kretschmer
Subject Re: Is it possible to make the order of output the same as the order of input parameters?
Date
Msg-id 20100602144700.GA16766@a-kretschmer.de
Whole thread Raw
In response to Re: Is it possible to make the order of output the same as the order of input parameters?  (Sam Mason <sam@samason.me.uk>)
Responses Re: Is it possible to make the order of output the same as the order of input parameters?  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
In response to Sam Mason :
> Isn't this fun; here's another version using window functions (from PG
> 8.4 onwards) this time:
>
>   SELECT c.*
>   FROM customer c, (
>     SELECT *, row_number() OVER ()
>     FROM (VALUES (23), (56), (2), (12), (10)) x) x(val,ord)
>   WHERE c.id = x.val
>   ORDER BY x.ord;

Wow, that's really cool and a nice case for row_number().
Thx.

Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Is it possible to make the order of output the same as the order of input parameters?
Next
From: Janning
Date:
Subject: replanning prepared Statements