<?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>《SQL的Where语句》的评论</title>
	<atom:link href="http://coolshell.cn/articles/1889.html/feed" rel="self" type="application/rss+xml" />
	<link>http://coolshell.cn/articles/1889.html</link>
	<description>享受编程和技术所带来的快乐 - http://coolshell.cn</description>
	<lastBuildDate>Sat, 11 Feb 2012 06:04:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>作者：ayanmw</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-107410</link>
		<dc:creator>ayanmw</dc:creator>
		<pubDate>Wed, 07 Dec 2011 10:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-107410</guid>
		<description>where 1=1 
and condition
那 本文的核心思想 是 支持 这样写法了...easy for 程序员,easy for 可读性.</description>
		<content:encoded><![CDATA[<p>where 1=1<br />
and condition<br />
那 本文的核心思想 是 支持 这样写法了&#8230;easy for 程序员,easy for 可读性.</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：PHP分页技术的代码和示例 &#124; 零度领域的博客-我的一米阳光</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-78790</link>
		<dc:creator>PHP分页技术的代码和示例 &#124; 零度领域的博客-我的一米阳光</dc:creator>
		<pubDate>Fri, 02 Sep 2011 07:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-78790</guid>
		<description>[...] 2009年12月01日 &#8212; SQL的Where语句 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2009年12月01日 &#8212; SQL的Where语句 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bzhu</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-25239</link>
		<dc:creator>bzhu</dc:creator>
		<pubDate>Wed, 26 Jan 2011 06:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-25239</guid>
		<description>&lt;a href=&quot;#comment-22346&quot; rel=&quot;nofollow&quot;&gt;@mark3536 &lt;/a&gt; 
在Oracle上 where true 和 where 1 都非法。</description>
		<content:encoded><![CDATA[<p><a href="#comment-22346" rel="nofollow">@mark3536 </a><br />
在Oracle上 where true 和 where 1 都非法。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：mark3536</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-22346</link>
		<dc:creator>mark3536</dc:creator>
		<pubDate>Sat, 08 Jan 2011 15:06:49 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-22346</guid>
		<description>&lt;blockquote cite=&quot;#commentbody-2715&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-2715&quot; rel=&quot;nofollow&quot;&gt;xLight&lt;/a&gt; :&lt;/strong&gt;
根本没必要 1=1 ，就 where 1 后面跟AND就行了，
看来这些程序员还是不够懒
&lt;/blockquote&gt;
WHERE TRUE 更通用，而 WHERE 1 在MYSQL上正常，在pgsql上出错。</description>
		<content:encoded><![CDATA[<blockquote cite="#commentbody-2715"><p>
<strong><a href="#comment-2715" rel="nofollow">xLight</a> :</strong><br />
根本没必要 1=1 ，就 where 1 后面跟AND就行了，<br />
看来这些程序员还是不够懒
</p></blockquote>
<p>WHERE TRUE 更通用，而 WHERE 1 在MYSQL上正常，在pgsql上出错。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：mark3536</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-22344</link>
		<dc:creator>mark3536</dc:creator>
		<pubDate>Sat, 08 Jan 2011 15:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-22344</guid>
		<description>&lt;blockquote cite=&quot;#commentbody-2214&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-2214&quot; rel=&quot;nofollow&quot;&gt;i_amok&lt;/a&gt; :&lt;/strong&gt;
但是这样的话，会造成索引没法利用。因为索引没法跨and，需要复合索引才可以跨and，如果第一个条件是1=1就啥索引都没法用了，具体还要看explain的分析。
&lt;/blockquote&gt;
i_amok@ccf?
pgsql 规划器会自动判断and条件是否需要走索引然后分解成多个单条搜索最后UNION起来。</description>
		<content:encoded><![CDATA[<blockquote cite="#commentbody-2214"><p>
<strong><a href="#comment-2214" rel="nofollow">i_amok</a> :</strong><br />
但是这样的话，会造成索引没法利用。因为索引没法跨and，需要复合索引才可以跨and，如果第一个条件是1=1就啥索引都没法用了，具体还要看explain的分析。
</p></blockquote>
<p>i_amok@ccf?<br />
pgsql 规划器会自动判断and条件是否需要走索引然后分解成多个单条搜索最后UNION起来。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：vvtommy</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-4757</link>
		<dc:creator>vvtommy</dc:creator>
		<pubDate>Wed, 27 Jan 2010 07:09:12 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-4757</guid>
		<description>&lt;a href=&quot;#comment-2715&quot; rel=&quot;nofollow&quot;&gt;@xLight&lt;/a&gt; 
我承认我很懒……</description>
		<content:encoded><![CDATA[<p><a href="#comment-2715" rel="nofollow">@xLight</a><br />
我承认我很懒……</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：xLight</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2715</link>
		<dc:creator>xLight</dc:creator>
		<pubDate>Mon, 28 Dec 2009 02:23:54 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2715</guid>
		<description>根本没必要 1=1 ，就 where 1 后面跟AND就行了，
看来这些程序员还是不够懒</description>
		<content:encoded><![CDATA[<p>根本没必要 1=1 ，就 where 1 后面跟AND就行了，<br />
看来这些程序员还是不够懒</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：半瓶墨水</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2510</link>
		<dc:creator>半瓶墨水</dc:creator>
		<pubDate>Wed, 16 Dec 2009 12:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2510</guid>
		<description>（没写完，续上）

后来干脆存储的时候就加上空格，比如：&quot; abcd bcd bcde &quot;，这样找起来就方便了，但是看起来有点怪异，跟楼主文中描述的很相近</description>
		<content:encoded><![CDATA[<p>（没写完，续上）</p>
<p>后来干脆存储的时候就加上空格，比如：” abcd bcd bcde “，这样找起来就方便了，但是看起来有点怪异，跟楼主文中描述的很相近</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：半瓶墨水</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2509</link>
		<dc:creator>半瓶墨水</dc:creator>
		<pubDate>Wed, 16 Dec 2009 12:15:16 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2509</guid>
		<description>我用过一种字符串查找的方法，跟这个神似：

存储tag的时候经常遇到用空格分割的一长串，比如“abcd bcd bcde&quot;

现在要找单词&quot;bcd&quot;，很难办，因为要区分是不是单独的单词，abcd和bcde是不算的

于是先在前后加上空格，然后在搜索词前后加上空格，就变成了在&quot; abcd bcd bcde &quot; 里面查找 &quot; bcd &quot;，一个find函数就搞定了</description>
		<content:encoded><![CDATA[<p>我用过一种字符串查找的方法，跟这个神似：</p>
<p>存储tag的时候经常遇到用空格分割的一长串，比如“abcd bcd bcde”</p>
<p>现在要找单词”bcd”，很难办，因为要区分是不是单独的单词，abcd和bcde是不算的</p>
<p>于是先在前后加上空格，然后在搜索词前后加上空格，就变成了在” abcd bcd bcde ” 里面查找 ” bcd “，一个find函数就搞定了</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：阿段</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2485</link>
		<dc:creator>阿段</dc:creator>
		<pubDate>Tue, 15 Dec 2009 14:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2485</guid>
		<description>为什么不 where true and XXX ?</description>
		<content:encoded><![CDATA[<p>为什么不 where true and XXX ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：gugaotianshi</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2313</link>
		<dc:creator>gugaotianshi</dc:creator>
		<pubDate>Mon, 07 Dec 2009 02:06:38 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2313</guid>
		<description>python 中有一个连接 list 的 join 函数，作用于类似 and 多个条件的情形，很好用，HOHO～～</description>
		<content:encoded><![CDATA[<p>python 中有一个连接 list 的 join 函数，作用于类似 and 多个条件的情形，很好用，HOHO～～</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：sunseesiu</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2249</link>
		<dc:creator>sunseesiu</dc:creator>
		<pubDate>Thu, 03 Dec 2009 07:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2249</guid>
		<description>呵呵，一直这么用的。</description>
		<content:encoded><![CDATA[<p>呵呵，一直这么用的。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：i_amok</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2246</link>
		<dc:creator>i_amok</dc:creator>
		<pubDate>Thu, 03 Dec 2009 03:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2246</guid>
		<description>&lt;a href=&quot;#comment-2233&quot; rel=&quot;nofollow&quot;&gt;@upsuper&lt;/a&gt; 

恩，测试过了，你是正确的。</description>
		<content:encoded><![CDATA[<p><a href="#comment-2233" rel="nofollow">@upsuper</a> </p>
<p>恩，测试过了，你是正确的。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：upsuper</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2233</link>
		<dc:creator>upsuper</dc:creator>
		<pubDate>Wed, 02 Dec 2009 14:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2233</guid>
		<description>&lt;a href=&quot;#comment-2214&quot; rel=&quot;nofollow&quot;&gt;@i_amok&lt;/a&gt; 
理论上说，根据mysql的官方文档，常数比较会被直接优化为true或false，索引的选取应该与此无关……</description>
		<content:encoded><![CDATA[<p><a href="#comment-2214" rel="nofollow">@i_amok</a><br />
理论上说，根据mysql的官方文档，常数比较会被直接优化为true或false，索引的选取应该与此无关……</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：i_amok</title>
		<link>http://coolshell.cn/articles/1889.html/comment-page-1#comment-2214</link>
		<dc:creator>i_amok</dc:creator>
		<pubDate>Wed, 02 Dec 2009 05:39:03 +0000</pubDate>
		<guid isPermaLink="false">http://coolshell.cn/?p=1889#comment-2214</guid>
		<description>但是这样的话，会造成索引没法利用。因为索引没法跨and，需要复合索引才可以跨and，如果第一个条件是1=1就啥索引都没法用了，具体还要看explain的分析。</description>
		<content:encoded><![CDATA[<p>但是这样的话，会造成索引没法利用。因为索引没法跨and，需要复合索引才可以跨and，如果第一个条件是1=1就啥索引都没法用了，具体还要看explain的分析。</p>
]]></content:encoded>
	</item>
</channel>
</rss>

