select * from Table where Branch1 is Null and Branch2 not like '%"不同意"%' or Branch3 not like '%"不同意"%' order by AddTime desc
我想查询出来Branch1字段为空,并且Branch2字段不包含不同意,或者Branch3字段不包含不同意的内容的所有记录,但查出来的记录是Branch1未空并且Branch2包含有不同意的内容的记录,这个语句到底应该怎么写啊??
select * from Table where Branch1 is Null and Branch2 not like '%"不同意"%' or Branch3 not like '%"不同意"%' order by AddTime desc
我想查询出来Branch1字段为空,并且Branch2字段不包含不同意,或者Branch3字段不包含不同意的内容的所有记录,但查出来的记录是Branch1未空并且Branch2包含有不同意的内容的记录,这个语句到底应该怎么写啊??
问题找到啦,是因为Branch2字段里是null不是空,所以查询语句出现问题,但还是谢谢你们!