Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by hub.org (8.10.1/8.10.1) with ESMTP id e8INSos68418 for ; Mon, 18 Sep 2000 19:28:50 -0400 (EDT) Received: from ipinc.com (jliang.ipinc.com [199.245.188.130]) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id QAA98647; Mon, 18 Sep 2000 16:28:11 -0700 (PDT) (envelope-from jliang@ipinc.com) Message-ID: <39C6A44A.3B58CAB1@ipinc.com> Date: Mon, 18 Sep 2000 16:24:59 -0700 From: Jie Liang Organization: ipinc.com X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.4-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Bernie Huang CC: PGSQL-SQL Subject: Re: Division References: <39C69B97.58B353A9@ec.gc.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200009/132 Hi, there, I don't quit sure what you really want to solve, however, if you use EXCEPT results1 and result2 should be same type rather than tables, i.e. select a,b from tab1 except select c,d from tab2; a,c are same type b,d are same type. notes, EXCEPT to big table is not efficient, so does IN clause. Bernie Huang wrote: > Hi, > > I tried the write up the following SQL statement: > > result1 from sql1 = (1,2,3,4,5) > result2 from sql2 = (4,5) > result3 = result1/result2 (or is it result2/result1) = (1,2,3) > > What do I have to do to get the (1,2,3) result? I tried "query EXCEPT > query", but it seems like EXCEPT needs both tables in queries to be of > the same number of columns and column types. And (any, all, exist) > doesn't seem to be a right solution. > > Thanks for help. > > - Bernie -- Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com