Re: SQL Syntax Queestion

From: Roger Loeb <rloeb_at_martech.com>
Date: Thu, 11 Jun 1998 19:53:04 -0600
Message-ID: <6lq1m1$1p4$1_at_news1.rmi.net>


Thanks. I knew there had to be an appropriate syntax for that ...

Rog


Mark Woytus wrote in message <357ebd13.13837257_at_news.dave-world.net>...
>On Tue, 9 Jun 1998 11:01:02 -0600, "Roger Loeb" <rloeb_at_martech.com>
>wrote:
><snip>
>>What I want to say is something like --
>>
>>Select * from Households where Households.LastName, Households.FirstName
IN
>>(Select LastName, FirstName from AnotherTable by LastName, FirstName
having
>>count (*) > 1);
>>
>>In other words, for any lastname+firstname combination that exists more
than
>>once in AnotherTable, I want to select the record for the same
>>lastname+firstname combination from the "Household" table. However, this
>>doesn't seem to do what I expect.
>>
>For matching multiple columns with a subselect, use parentheses.
>
>select * from households
>where (households.lastname, households.firstname) in
> (select lastname, firstname from anothertable
> having count(*) > 1
> group by lastname, firstname);
>Mark Woytus (w)309.888.8423 (f)309.888.8246
>Diversified Computer Consultants
>mwoytus_at_divcomp.com woytus_at_acm.org
Received on Fri Jun 12 1998 - 03:53:04 CEST

Original text of this message