Re: Is it possible to make the order of output the same as the order of input parameters?

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Is it possible to make the order of output the same as the order of input parameters?
Дата
Msg-id 20100602144700.GA16766@a-kretschmer.de
обсуждение исходный текст
Ответ на Re: Is it possible to make the order of output the same as the order of input parameters?  (Sam Mason <sam@samason.me.uk>)
Ответы Re: Is it possible to make the order of output the same as the order of input parameters?  (Sam Mason <sam@samason.me.uk>)
Список 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 по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Is it possible to make the order of output the same as the order of input parameters?
Следующее
От: Janning
Дата:
Сообщение: replanning prepared Statements