Re: select where expr in - result order?

From: Brian Minton <bminton(at)efn(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: select where expr in - result order?
Date: 2002-11-20 22:30:43
Message-ID: arh2eh$ofp$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Doug McNaught wrote:
> "Andy Kriger" <akriger(at)greaterthanone(dot)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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brian Minton 2002-11-20 22:36:34 Re: get_bit etc.
Previous Message Oliver Elphick 2002-11-20 22:12:58 Re: [GENERAL] Bug with sequence