Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not exists sql condition

Status
Not open for further replies.

wgg

Programmer
Apr 25, 2001
47
BB
Hello All

I would like to know if it is possible to get records printed in Crystal, which fit the following kind of 'not exists' condition.

****Example****
Select id1, name1 from table1 a where not exists (select id1, name1 from table2 b where b.id1 = a.id1)
***

NB I would like the records printed in table1 which don't have matching records in table2. If this is possible how can it be done?

Thank you.

wgg
 
What database driver are you using?
Have you considered using a stored procedure or view? This is the most robust way to pass more complex queries through to Crystal.
 
One very simple way is go into the Visual Linking Expert and connect table A to table B as a LEFT JOIN.

Then go to the Details section and suppress records where B.Id Is Not NULL.
 
Thanks for your suggestions. I will give them a try.

wgg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top