0
我不是工作statement--情况下使用foloowing查询与案件在MySQL查询所需
SELECT case WHEN t1.abc !='' THEN 1 ELSE 0 END as ids FROM
table1 AS t1 LEFT JOIN table2 as t2
ON t1.pid = t2.id
WHERE t2.idr IS NULL and t1.idr=23
在其即时通讯在IDS得到1时查询返回行,但查询时没有返回值则不会返回0 。为什么??
我需要的是,当查询返回一行时,它应该返回1,如果没有结果显示,那么它应该返回0.我在哪里出错?
我想你必须使用''''而不是'!=' – ariel 2011-05-09 05:50:47
不,结果是相同的,即使<> – developer 2011-05-09 05:53:06
检查这个http://stackoverflow.com/questions/334108/how-do -i-check-if-a-sql-server-string-is-null-or-empty – ariel 2011-05-09 05:54:45