Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 655F94762C2 for ; Thu, 12 Sep 2002 16:18:41 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id A8D2E476275 for ; Thu, 12 Sep 2002 16:18:40 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g8CKIJKo009597; Thu, 12 Sep 2002 16:18:19 -0400 (EDT) To: Andrew Perrin Cc: Stephan Szabo , pgsql-sql@postgresql.org Subject: Re: LIMIT within UNION? In-reply-to: References: Comments: In-reply-to Andrew Perrin message dated "Thu, 12 Sep 2002 16:03:54 -0400" Date: Thu, 12 Sep 2002 16:18:19 -0400 Message-ID: <9596.1031861899@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/120 X-Sequence-Number: 9397 Andrew Perrin writes: > Interesting - this would count on the UNION including all cases in the > first query before those in the second query. Are UNIONed records > presented in any predictable order? If you can use UNION ALL then this would be pretty safe to rely on. If you must use UNION (to eliminate dups) then it won't work. regards, tom lane