1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

SQL and JOIN

Discussion in 'Microsoft News' started by NewsBot, Apr 5, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    Im using Sql Server 2005 but this is a general SQL question.

    I've been using JOIN for some time in the form:
    SELECT * FROM MyTable mt JOIN MyStuff ms ON mt.ID = ms.ID WHERE ms.Labels = 22;

    My question is, what if i did this:
    SELECT * FROM MyTable mt JOIN MyStuff ms ON ms.Labels = 22 AND mt.ID = ms.ID;

    The WHERE clause was dropped and the ms.Labels was moved to be apart of the ON area. Whats the difference? What kinds of results can i expect back as compared to using the WHERE. Is there some major consequence of using it in this way?

    Tx



     

Share This Page