Re:

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re:
Дата
Msg-id dcc563d10811050914g4cf17d46q41cf32367abfecd7@mail.gmail.com
обсуждение исходный текст
Ответ на Re:  (Hemant Patel <hemant.patel@impetus.co.in>)
Список pgsql-sql
On Wed, Nov 5, 2008 at 9:21 AM, Hemant Patel <hemant.patel@impetus.co.in> wrote:
> Let Say I have the array of primary key of some table say XYZ.
>
> For e.g. (555,222,333,111)
>
>
>
> When I query for these results I will get the result like  in the order of
> (111,222,333,555) .
>
> So now I need to process in the business logic to maintain the search
> criteria.

The fact that you get results in a certain order without using an
order by clause is a happy coincidence, and not to be relied upon.
Should PostgreSQL choose a different query plan they may come back in
some other order.

I.e. you HAVE to use an order by clause if you want a certain order.  period.


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

Предыдущее
От: Hemant Patel
Дата:
Сообщение: Re:
Следующее
От: "Devil™ Dhuvader"
Дата:
Сообщение: Re: need help in building a query