Distinct from two tables

2006-06-29 Thread Mark Steudel
Is there a way get distinct results between pf and sf?

Select
pf.name,
sf.name
From
tblpropertyfeatures,
tblsuitefeatures
Inner Join tblfeatures AS pf ON tblpropertyfeatures.featureid = pf.id
Inner Join tblfeatures AS sf ON tblsuitefeatures.featureid = sf.id

-
Mark Steudel
NetRiver
Web and Application Developer
555 Dayton St.
Suite A
Edmonds, WA 98020
w: http://www.netriver.net
p: 425.741.7014




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Distinct from two tables

2006-06-29 Thread Peter Brawley




Mark Steudel wrote:

  Is there a way get distinct results between pf and sf?

Select
pf.name,
sf.name
From
tblpropertyfeatures,
tblsuitefeatures
Inner Join tblfeatures AS pf ON tblpropertyfeatures.featureid = pf.id
Inner Join tblfeatures AS sf ON tblsuitefeatures.featureid = sf.id
  

Do you mean ...

SELECT 
  MIN(TableName) as TableName, id, name
FROM (
  SELECT 'Table a' as TableName, a.id, a.name
  FROM tblpropertyfeatures
  UNION ALL
  SELECT 'Table b' as TableName, b.id, b.name
  FROM tblsuitefeatures
) AS tmp
GROUP BY id, name
HAVING COUNT(*) = 1
ORDER BY ID;

PB


  
-
Mark Steudel
NetRiver
Web and Application Developer
555 Dayton St.
Suite A
Edmonds, WA 98020
w: http://www.netriver.net
p: 425.741.7014




  



No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.7/379 - Release Date: 6/29/2006


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]