SQL Syntax Queestion

From: Roger Loeb <rloeb_at_martech.com>
Date: Tue, 9 Jun 1998 11:01:02 -0600
Message-ID: <6ljpof$97v$1_at_news1.rmi.net>



I am trying to handle some duplication logic in SQL and I don't understand the syntax for a compound key.

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.

Do I need to do something like concatenate the two fields together in both parts of the statement?

TIA, Rog

--
roger_at__delete_this_to_reply_.martech.com
Received on Tue Jun 09 1998 - 19:01:02 CEST

Original text of this message