Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3QCXe310094 for ; Thu, 26 Apr 2001 08:33:40 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3PLu0306253 for ; Wed, 25 Apr 2001 17:56:00 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f3PLbEO81051 for pgsql-sql@postgresql.org; Wed, 25 Apr 2001 17:37:14 -0400 (EDT) (envelope-from news) From: "Wei Weng" X-Newsgroups: comp.databases.postgresql.sql Subject: simulate union in subselect Date: Wed, 25 Apr 2001 18:42:20 -0400 Organization: KenCast Lines: 12 Message-ID: <9c7g2a$2f4o$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: scrappy@hub.org User-Agent: Pan/0.9.6 (Unix) To: pgsql-sql@postgresql.org X-Archive-Number: 200104/402 X-Sequence-Number: 2760 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; Thanks a lot Wei