Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Dereferencing nested references

by ryddler (Monk)
on Jan 16, 2001 at 14:57 UTC ( [id://52255]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Dereferencing nested references
in thread Dereferencing nested references

Mainly I wasn't using a JOIN because I haven't done much database work, and am not familiar with all that can be done with SQL calls. After breaking down your statement I can see where it would be very efficient, unfortunately in my case the second table may not have any data when I make the calls, and I still need to return the info from the first table regardless. It looks to me like this statement will return "all or nothing." Is this true?

ryddler
  • Comment on Re: Re: Dereferencing nested references

Replies are listed 'Best First'.
Re: Re: Re: Dereferencing nested references
by jeroenes (Priest) on Jan 16, 2001 at 15:20 UTC
    ryddler, you'll just have to ponder SQL a little bit harder. Because, you can make outer joins as well. Generally:
    SELECT name, 'In table2!' FROM table1 WHERE ID IN (SELECT ID FROM table2) JOIN SELECT name, 'Not in table2!' FROM table1 WHERE NOT ID IN (SELECT ID FROM table2);
    Well, this isn't beautiful SQL either, as you write two subselects, but it gets the job done. Whatever the columns and order in which you want it be returned, it really can be done in SQL. Look here for a tutorial.

    Jeroen
    "We are not alone"(FZ)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://52255]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.