X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id EEBA99DC985 for ; Sat, 25 Mar 2006 03:44:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76526-02 for ; Sat, 25 Mar 2006 03:44:26 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from 137086.vserver.de (vs137086.vserver.de [62.75.137.86]) by postgresql.org (Postfix) with ESMTP id E8F719DC9CA for ; Sat, 25 Mar 2006 03:44:23 -0400 (AST) Received: from a-kretschmer.de (p54B39F1E.dip0.t-ipconnect.de [84.179.159.30]) (authenticated bits=0) by 137086.vserver.de (8.12.8/8.12.8) with ESMTP id k2P7iJE4006629 for ; Sat, 25 Mar 2006 08:44:20 +0100 Received: from kretschmer by a-kretschmer.de with local (Exim 4.60) (envelope-from ) id 1FN3T8-0008E8-RB for pgsql-sql@postgresql.org; Sat, 25 Mar 2006 08:45:54 +0100 Date: Sat, 25 Mar 2006 08:45:54 +0100 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: regarding join Message-ID: <20060325074554.GA6978@KanotixBox> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: mutt-ng 1.5.9i (Linux) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.123 required=5 tests=[AWL=0.123] X-Spam-Score: 0.123 X-Spam-Level: X-Archive-Number: 200603/406 X-Sequence-Number: 24752 AKHILESH GUPTA schrieb: > hi all, > below I have created two tables in pgsql with field name as 'name' and 'id' as > their datatype 'varchar(15)' and 'integer'. > i want the output as:-> ... a UNION of this 2 tables: test=# select * from test1 union select * from test3 order by 2,1; name | id -------+---- ab | 1 akhil | 1 b | 2 cd | 2 c | 3 ef | 3 d | 4 gh | 4 e | 5 f | 6 (10 rows) HTH, Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknow) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°