Received: from parmastocks2.cylink.com.cy (parmastocks2.cylink.com.cy [194.42.142.6]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7KHiKP12289 for ; Mon, 20 Aug 2001 13:44:21 -0400 (EDT) (envelope-from grigoriy.vovk@linustech.com.cy) Received: from [192.168.1.2] (parmastocks.cylink.com.cy [194.42.135.92]) by parmastocks2.cylink.com.cy (Postfix) with ESMTP id 0B8CC34080; Mon, 20 Aug 2001 20:39:19 +0300 (EEST) Date: Mon, 20 Aug 2001 20:43:17 +0300 (EEST) From: "Grigoriy G. Vovk" X-X-Sender: To: Mark Mikulec Cc: Subject: Re: Sequential select queries...?? In-Reply-To: <3B79C512.9F6E09B7@badger.ac.brocku.ca> Message-ID: <20010820203847.Y556-100000@callisto.internal.linustech.com.cy> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200108/250 X-Sequence-Number: 4488 I don't knoe, may be I don't understand the question, but for me its looking like UNION statement. For example: select id from T where name='bleh' UNION select id from T where description='bleh'; Aug 14, 20:40 -0400, Mark Mikulec wrote: > Hello, > > At first I thought what I was trying to do was simple and could be done > easily - but alas, I've spent way too much time and could not figure out > how to get the results in question. > > Let's say I have a table T comprised of id of type integer, name and > description both of type text. > > What i'd like to do is the following: > > Select id from T where name = 'bleh'; > > and > > Select id from T where description = 'bleh'; > > and result both results in the same result set. That is, duplicate id's > if they appear. So then I could do a GROUP BY and a COUNT to see how > many appeared in only one, and how many appeared in both. > > Could someone help me? I've tried countless different sql queries, can't > seem to get one to work. If I can just get those duplicate id's in the > query.. then I'd be laughing and then I can complete my task. > > Thanks in advance, > > Mark > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > my best regards, ---------------- Grigoriy G. Vovk