List:General Discussion« Previous MessageNext Message »
From:joe j Date:June 7 2011 4:00pm
Subject:Re: IN clause
View as plain text  
ok. here's what I am trying now. First create a table with the code
below with a list of countries that have the two person names I want.
CREATE TABLE `table_new` SELECT t1.country
FROM `table_old` as t1
JOIN
`table_old` as t2
USING(country)
JOIN
`table_old` as t3
USING(country)
WHERE (t2.`person_name` ='Tom' )
AND (t3.`person_name` ='Kevin' )
GROUP BY (country)

In the next step LEFT JOIN this to the original table USING(country).
I guess this would work.
Thread
IN clausejoe j7 Jun
  • Re: IN clauseWilly Mularto7 Jun
    • Re: IN clausejoe j7 Jun
      • Re: IN clausejoe j7 Jun
  • Re: IN clausehsv9 Jun