Sequential select queries...?? - Mailing list pgsql-sql

From Mark Mikulec
Subject Sequential select queries...??
Date
Msg-id 3B79C512.9F6E09B7@badger.ac.brocku.ca
Whole thread Raw
Responses RE: Sequential select queries...??  ("Robby Slaughter" <webmaster@robbyslaughter.com>)
Re: Sequential select queries...??  ("Josh Berkus" <josh@agliodbs.com>)
Re: Sequential select queries...??  ("Grigoriy G. Vovk" <grigoriy.vovk@linustech.com.cy>)
Re: Sequential select queries...??  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "Jayson Callaway"
Date:
Subject: SQL Statement too long
Next
From: Jean-Christophe Boggio
Date:
Subject: Strange DISTINCT !