Re: select where expr in - result order?

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: select where expr in - result order?
Дата
Msg-id m3ptt1jgf2.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на select where expr in - result order?  ("Andy Kriger" <akriger@greaterthanone.com>)
Список pgsql-general
"Andy Kriger" <akriger@greaterthanone.com> writes:

> Is there any way to guarantee that the when using
> SELECT * FROM tbl WHERE expr IN (scalar[,...])
> the results are returned in the same order as the scalar list?
>
> I realize I can do this by sorting the scalar list and using ORDER BY expr,
> but I'd like to not count on a sorted list of scalars if at all possible.

Nope, I'm pretty sure ORDER BY is the only way to do this.  SQL
queries don't in general guarantee any ordering unless an ORDER BY
clause is used.

-Doug

В списке pgsql-general по дате отправления:

Предыдущее
От: "Andy Kriger"
Дата:
Сообщение: select where expr in - result order?
Следующее
От: Andrew Magnus
Дата:
Сообщение: Re: Getting a list of tables in a database with Perl