<><FONT size=3>加个括号到and之后</FONT></P><><FONT size=3>否则,后面的or有一个条件成立了,就会忽略and前面的内容了。</FONT></P><FONT face="Courier New" color=#cc3333 size=3>select * from [bbsxp_threads] where isdel=0 and <FONT color=#ff0000><STRONG>(</STRONG></FONT>ForumID=18 or ForumID=19 or ForumID=20 or ForumID=21 or ForumID=7 or ForumID=8 or ForumID=9 or ForumID=10 or ForumID=11 or ForumID=2 or ForumID=3 or ForumID=4 or ForumID=5<FONT color=#ff0000><STRONG>)</STRONG></FONT> order by lasttime desc,id</FONT><br>< align=right><FONT color=#e4e7e5> [ 此帖子已被 雄鹰展翅 在 2008-6-23 22:02:24 编辑过 ]</FONT>
<><FONT face="Courier New" color=#cc3333 size=3>select * from [bbsxp_threads] where isdel=0 and ForumID=18 or ForumID=19 or ForumID=20 or ForumID=21 or ForumID=7 or ForumID=8 or ForumID=9 or ForumID=10 or ForumID=11 or ForumID=2 or ForumID=3 or ForumID=4 or ForumID=5 order by lasttime desc,id</FONT></P><><FONT size=3>为什么我实际执行中,isdel=0总是起不到作用呢?</FONT></P><><FONT size=3>我用 <FONT face="Courier New" color=#d52b2b>select * from [bbsxp_threads] where isdel=0 order by lasttime desc,id </FONT>它却是生效的 <BR></FONT></P>