Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3QFHT398456 for ; Thu, 26 Apr 2001 11:17:29 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f3QFH7R16270; Thu, 26 Apr 2001 11:17:07 -0400 (EDT) To: "Wei Weng" cc: pgsql-sql@postgresql.org Subject: Re: simulate union in subselect In-reply-to: <9c7g2a$2f4o$1@news.tht.net> References: <9c7g2a$2f4o$1@news.tht.net> Comments: In-reply-to "Wei Weng" message dated "Wed, 25 Apr 2001 18:42:20 -0400" Date: Thu, 26 Apr 2001 11:17:07 -0400 Message-ID: <16267.988298227@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200104/407 X-Sequence-Number: 2769 "Wei Weng" writes: > I know this is not do-able, but is there any way to simulate the > following in Postgresql 7.1? > select id from > (select id, recv_date as date from table1 > union > select id, send_date as date from table2) AS subtable > order by date; What gives you the idea that this doesn't work? regards, tom lane