<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: Using SQL Where Clauses for Searching</title> <atom:link href="http://scottelkin.com/programming/using-sql-where-clauses-for-searching/feed/" rel="self" type="application/rss+xml" /><link>http://scottelkin.com/programming/using-sql-where-clauses-for-searching/</link> <description>Tech, Love, Life</description> <lastBuildDate>Fri, 18 May 2012 16:27:45 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: 尖锐湿疣</title><link>http://scottelkin.com/programming/using-sql-where-clauses-for-searching/comment-page-1/#comment-210</link> <dc:creator>尖锐湿疣</dc:creator> <pubDate>Sun, 26 Jun 2005 18:19:00 +0000</pubDate> <guid isPermaLink="false">/archive/2005/05/06/Using-SQL-Where-Clauses-for-Searching.aspx#comment-210</guid> <description>It&#039;s cool.</description> <content:encoded><![CDATA[<p>It&#8217;s cool.</p> ]]></content:encoded> </item> <item><title>By: http://</title><link>http://scottelkin.com/programming/using-sql-where-clauses-for-searching/comment-page-1/#comment-209</link> <dc:creator>http://</dc:creator> <pubDate>Mon, 23 May 2005 13:46:00 +0000</pubDate> <guid isPermaLink="false">/archive/2005/05/06/Using-SQL-Where-Clauses-for-Searching.aspx#comment-209</guid> <description>Just to say thanks!! this is a great article and helps keep my queries simple!!</description> <content:encoded><![CDATA[<p>Just to say thanks!! this is a great article and helps keep my queries simple!!</p> ]]></content:encoded> </item> <item><title>By: http://</title><link>http://scottelkin.com/programming/using-sql-where-clauses-for-searching/comment-page-1/#comment-208</link> <dc:creator>http://</dc:creator> <pubDate>Sun, 08 May 2005 10:27:00 +0000</pubDate> <guid isPermaLink="false">/archive/2005/05/06/Using-SQL-Where-Clauses-for-Searching.aspx#comment-208</guid> <description>You say &quot;This is time consuming and doesn&#039;t allow SQL server to optimize your queries&quot; but the alternative limits SQL Server&#039;s ability to optimize the query as well.  It would be forced to perform a full table scan on the Customers table rather than using indexes on the columns you&#039;re searching on.</description> <content:encoded><![CDATA[<p>You say &#8220;This is time consuming and doesn&#8217;t allow SQL server to optimize your queries&#8221; but the alternative limits SQL Server&#8217;s ability to optimize the query as well.  It would be forced to perform a full table scan on the Customers table rather than using indexes on the columns you&#8217;re searching on.</p> ]]></content:encoded> </item> <item><title>By: Scott Elkin</title><link>http://scottelkin.com/programming/using-sql-where-clauses-for-searching/comment-page-1/#comment-207</link> <dc:creator>Scott Elkin</dc:creator> <pubDate>Sat, 07 May 2005 18:21:00 +0000</pubDate> <guid isPermaLink="false">/archive/2005/05/06/Using-SQL-Where-Clauses-for-Searching.aspx#comment-207</guid> <description>Actually, if the lastname is null, then &#039;&#039; will be returned as you said. And if @lastname is null, then it will return the third argument, &#039;&#039;, in the COALESCE() function. So &#039;&#039; = &#039;&#039;.  Remember, COALESCE returns the first non-null value, and &#039;&#039; will never be null.</description> <content:encoded><![CDATA[<p>Actually, if the lastname is null, then &#8221; will be returned as you said. And if @lastname is null, then it will return the third argument, &#8221;, in the COALESCE() function. So &#8221; = &#8221;.  Remember, COALESCE returns the first non-null value, and &#8221; will never be null.</p> ]]></content:encoded> </item> <item><title>By: SMR</title><link>http://scottelkin.com/programming/using-sql-where-clauses-for-searching/comment-page-1/#comment-206</link> <dc:creator>SMR</dc:creator> <pubDate>Sat, 07 May 2005 16:57:00 +0000</pubDate> <guid isPermaLink="false">/archive/2005/05/06/Using-SQL-Where-Clauses-for-Searching.aspx#comment-206</guid> <description>Interesting approach.   There seems to be one problem though:  What happens if both lastname and @lastname are null. This resolves to &#039;&#039; = NULL which is false, which may give wrong results.   I think if you take out the isnull portion (or put it into the coalesce) for the fieldname you will get the results you expect.</description> <content:encoded><![CDATA[<p>Interesting approach.   There seems to be one problem though:  What happens if both lastname and @lastname are null. This resolves to &#8221; = NULL which is false, which may give wrong results.   I think if you take out the isnull portion (or put it into the coalesce) for the fieldname you will get the results you expect.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)

Served from: scottelkin.com @ 2012-05-22 04:30:41 -->
