Subqueries II

  • Comments posted to this topic are about the item Subqueries II

  • Two of the options look identical.  I'm not sure there's a right answer to this at the moment.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • There are all sorts of wrong with that code, but only one that actually stops it from executing.


    Just because you're right doesn't mean everybody else is wrong.

  • If you're just seeing if the customerid exists in the other table shouldn't this be an EXISTS clause? No need to return the results of the subquery just see if what you need is there or not and be on your way...

  • joshua.banks wrote:

    If you're just seeing if the customerid exists in the other table shouldn't this be an EXISTS clause? No need to return the results of the subquery just see if what you need is there or not and be on your way...

    True, but if you look closely at the subquery, it doesn't quite do that. Probably not intentionally, though...


    Just because you're right doesn't mean everybody else is wrong.

  • Two answers are the same. I wanted to pick that you can't have ORDER BY in a subquery but that wasn't an option.

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Apologies for the duplicate answer. That doesn't affect the question, but I'll award back points and change it to something else (wrong).

  • Thanks, Steve! Always appreciate your QOTD.

    -- webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply