Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.4) with SMTP id f7KEIhP32875 for ; Mon, 20 Aug 2001 10:18:43 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7F12rP90788 for ; Tue, 14 Aug 2001 21:02:53 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f7F0bQK35680 for pgsql-sql@postgresql.org; Tue, 14 Aug 2001 20:37:26 -0400 (EDT) (envelope-from news) From: Mark Mikulec X-Newsgroups: comp.databases.postgresql.sql Subject: Sequential select queries...?? Date: Tue, 14 Aug 2001 20:40:50 -0400 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 29 Message-ID: <3B79C512.9F6E09B7@badger.ac.brocku.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200108/243 X-Sequence-Number: 4475 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