﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Bradley Deem  / Where and Join On Clause the Same? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 04:33:47 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>Question is superb. Its simple but gives major difference.For the first statement, It joins and evaluates the where condition. But for second it evaluates the condition while applying joins .Thats the difference.:-)</description><pubDate>Fri, 15 May 2009 03:10:45 GMT</pubDate><dc:creator>prabhu_hl007</dc:creator></item><item><title>RE: Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>Here's how I see the difference. It may help you to understand the order of execution, or it may just confuse you, but it's how I read the statements semantically. Your results may vary. :-P[code]SELECT * FROM T1LEFT JOIN T2   ON t1.col1 = t2.col1WHERE t2.col1 IS NULL[/code]is telling the server to filter [b]the result set[/b] to those rows with a NULL value in the column output from t2.col1, whereas[code]SELECT * FROM T1LEFT JOIN T2   ON t1.col1 = t2.col1  AND t2.col1 IS NULL[/code]is telling the server to condition the join on there being a NULL value in t2.col1 (i.e, to filter [b]the input from t2 into the join[/b] to rows with a NULL in t2.col1)</description><pubDate>Thu, 07 May 2009 11:46:43 GMT</pubDate><dc:creator>sknox</dc:creator></item><item><title>RE: Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>Good question but not well presented. Try it on a database which is case sensitive and you get "none of the above"! Case is always important and as they say at the FBI Academy "To assume makes ..." (courtesy of the Silence of the Lambs)</description><pubDate>Tue, 05 May 2009 08:43:46 GMT</pubDate><dc:creator>john.botibol</dc:creator></item><item><title>RE: Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>[quote][b]dunnjoe (5/4/2009)[/b][hr]Good question. I had to debug an issue just like this last week with one of the developers. We decided we liked the old style syntax better![/quote]I prefer the ANSI style better.  It separates the join criteria from filter criteria.</description><pubDate>Mon, 04 May 2009 10:50:27 GMT</pubDate><dc:creator>Lynn Pettis</dc:creator></item><item><title>RE: Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>An explanation of why the order of evaluation, "from" followed by "where" has this effect is in order here. Merely stating that the order of evaluation as the reason misses an important lesson.</description><pubDate>Mon, 04 May 2009 10:01:52 GMT</pubDate><dc:creator>sjsubscribe</dc:creator></item><item><title>RE: Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>Good question. I had to debug an issue just like this last week with one of the developers. We decided we liked the old style syntax better!</description><pubDate>Mon, 04 May 2009 08:51:13 GMT</pubDate><dc:creator>dunnjoe</dc:creator></item><item><title>RE: Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>Excellent question.  This is one of the things you have to watch for when converting a query that uses the old style outer joins to the ANSI standard outer joins.  What may seem to be a filter condition in the where clause may aslo need to be moved to the FROM clause as part of the join criteria.</description><pubDate>Mon, 04 May 2009 06:54:36 GMT</pubDate><dc:creator>Lynn Pettis</dc:creator></item><item><title>Where and Join On Clause the Same?</title><link>http://www.sqlservercentral.com/Forums/Topic708968-1541-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/66271/"&gt;Where and Join On Clause the Same?&lt;/A&gt;[/B]</description><pubDate>Sat, 02 May 2009 13:40:30 GMT</pubDate><dc:creator>Bradley Deem</dc:creator></item></channel></rss>