Received: from orion.SAPserv.Hamburg.dsh.de (Tpolaris2.sapham.debis.de [53.2.131.8]) by hub.org (8.9.3/8.9.3) with SMTP id KAA24488 for ; Thu, 9 Dec 1999 10:36:01 -0500 (EST) (envelope-from wieck@debis.com) Received: by orion.SAPserv.Hamburg.dsh.de for pgsql-sql@postgreSQL.org id m11w5Tn-0003kGC; Thu, 9 Dec 99 16:27 MET Message-Id: From: wieck@debis.com (Jan Wieck) Subject: Re: [SQL] subquery, except and view To: wdemoudt@planetinternet.be (De Moudt Walter) Date: Thu, 9 Dec 1999 16:27:39 +0100 (MET) Cc: Max.Buvry@enseeiht.fr, pgsql-sql@postgreSQL.org Reply-To: wieck@debis.com (Jan Wieck) In-Reply-To: <384F0FEF.1BF044B1@planetinternet.be> from "De Moudt Walter" at Dec 9, 99 03:11:59 am X-Mailer: ELM [version 2.4 PL25] Content-Type: text > test :>select client.num_clt, client.name from client, commamount where > test :>(client.num_clt = commamount.num_clt) and > test :>(3 > howmuch); > > This seems to do the job perfectly. Notice the value preceeding the > column name in the comparison. Seems nescesary ... Is definitely necessary, because 'howmuch' is an aggregate column and the rewriter can only put that into the qualification if the aggreate is on the right side of the comparision. At the time I added this capability at all, the operator catalog was in a much too bad state WRT the commutator/negator information. Otherwise I would have made the rewriter automatically swap it for you. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #========================================= wieck@debis.com (Jan Wieck) #