Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^4: nested dbi queries question

by VSarkiss (Monsignor)
on Feb 02, 2005 at 16:39 UTC ( #427319=note: print w/replies, xml ) Need Help??

in reply to Re^3: nested dbi queries question
in thread nested dbi queries question

The problem is that your subselect is not correlated. In other words, you need to join sp in the main query to supplier in the subquery -- don't join the tables in the subquery. Specifically, the query should be:

SELECT * FROM sp WHERE NOT EXISTS ( SELECT 1 FROM supplier -- note SP doesn't appear here! WHERE supplier.num = sp.num -- sp is from main query )
I wrote the same thing in my reply below, but didn't point it out specifically.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427319]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2022-06-30 08:13 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (97 votes). Check out past polls.