>-----Original Message----- >From: Yong Lee [mailto:[EMAIL PROTECTED] >Sent: Wednesday, May 21, 2008 3:10 PM >To: 'Chris W'; 'Jerry Schwartz'; 'MYSQL General List' >Subject: RE: Match/No Match query > >chris, > >you're going to need a source for all the distinct codes that you may >see in >your product table....ie: if you don't have a full list somewhere (like >your >temp table) you cannot do your query because you have nothing to compare >against. > [JS] That's the conclusion I reached, but I wasn't sure that there wasn't some trick I was missing.
>assuming you had some table X which had a list of all the possible codes >and >you could generate the complete list by doing something like : > >select distinct code from X; > >you could use this in your sql statement like : > >select p.prod_num, p.code from products p left join (select distinct >code >from X) as codes on p.code = codes.code; > [JS] Actually, I don't want distinct values; I'm actually looking for duplicates, so I use GROUP BY ... HAVING Thanks for confirming my conclusions. >Yong. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]