Received: from gateway.indvalley.com (ptil-134-144-ban.primus-india.net [203.196.144.134] (may be forged)) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAD5mum54559 for ; Tue, 13 Nov 2001 00:49:01 -0500 (EST) (envelope-from guru@indvalley.com) Received: from GURU ([192.168.0.20]) by gateway.indvalley.com (8.11.2/8.11.2) with ESMTP id fAD5r8u03059 for ; Tue, 13 Nov 2001 11:23:19 +0530 Date: Tue, 13 Nov 2001 11:15:43 +0530 From: Gurudutt X-Mailer: The Bat! (v1.52f) Reply-To: Gurudutt Organization: Indus Valley X-Priority: 3 (Normal) Message-ID: <35769563.20011113111543@indvalley.com> To: pgsql-sql@postgresql.org Subject: Joins!! MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200111/162 X-Sequence-Number: 5546 Hello, I have few set of questions for the PGSQL list users Q 1. Consider the following query, suppose I want the sum of the tickettabcount and ticketmultabcount, how do I modify my query to get the same. If I use operator "+" in between these, it's been ignored by the PgSQL and throws a error!! QUERY ----- select count(tickettab.tokenid) as tickettabcount, (select count(tokenid) from ticketmultab where agentid='danny' and arrivaldate='2001-11-12') as ticketmultabcount from tickettab where tickettab.agentid='danny' and tickettab.arrivaldate='2001-11-12' RESULT ------- tickettabcount || ticketmultabcount ------------- ------------------ 9 2 Q 2. I join two tables, I get a result set which has values from both the tables, now if I want to sort the combination of the result set how do I do that!!, not the individual table result set. Hoping for positive reply, thanks!! -- Best regards, Gurudutt mailto:guru@indvalley.com Life is not fair - get used to it. Bill Gates