Re:

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Hemant Patel" <hemant(dot)patel(at)impetus(dot)co(dot)in>
Cc: "ries van Twisk" <pg(at)rvt(dot)dds(dot)nl>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re:
Date: 2008-11-05 17:14:42
Message-ID: dcc563d10811050914g4cf17d46q41cf32367abfecd7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Nov 5, 2008 at 9:21 AM, Hemant Patel <hemant(dot)patel(at)impetus(dot)co(dot)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.

In response to

  • Re: at 2008-11-05 16:21:21 from Hemant Patel

Browse pgsql-sql by date

  From Date Subject
Next Message Devil™ Dhuvader 2008-11-06 16:15:44 Re: need help in building a query
Previous Message Hemant Patel 2008-11-05 16:21:21 Re: