就是有个判断,当L3不为0或者zgcs字段不为空都可以,都算
比如L3为0,字段不为空,可以算作符合的1条;
L3为1,字段为空,也可以算作符合的1条;
共计就是2条
WHERE CJ='"+Z3+"' AND ('"+L3+"'!='0' or ZGCS IS NOT NULL)group by txtime,CJ
SqlServer
WHERE CJ='"+Z3+"' AND ('"+L3+"'!='0' or isnull(ZGCS,'')<>'')group by txtime,CJ
oracle
WHERE CJ='"+Z3+"' AND ('"+L3+"'!='0' or NVL(ZGCS,'')<>'')group by txtime,CJ
单引号去掉试试