You are here: Not Exists joining 2 tables « MsSQL Server « IT news, forums, messages
Not Exists joining 2 tables

Posted by Artie on 10/23/07 18:52

Hi,
I was hoping somebody could assist me with this. I need to find accounts
that do not contain a contact person called 'Accounting'. Each account may
contain multiple contacts.

Here's my query to find accounts that DO contain an 'Accounting' contact:

SELECT company.code, company.name, company.type,
contacts.fullname
FROM company INNER JOIN
contacts ON company.code = contacts.code
WHERE (company.type in ('C', 'R')) and (contacts.fullname =
'Accounting')
order by company.code


How do I find accounts that DO NOT contain an 'Accounting' contact?

Thanks

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация