请教一查询语句,在线等待 有一个表name code 王 null李 null张 1邓 1梁 2我要查询code不等于2的值,我用select * from 表1 where code!=2怎么查出来只有张,邓,二行,王李这二行不出来也 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from 表1 where code<>2 and code is not null select * from 表1 where code<>2 or code is null select * from 表1 where code not in (select select * from 表1 where code<>2) select * from 表名 where isnull(code,0)!=2 select * from 表1 where code is null or code <> 2 我要的是王 null李 null张 1邓 1 select * from 表1 where code<>2 or code is null select * from 表名 where isnull(code,0)!=2 select * from 表1 where code not in (select select * from 表1 where code<>2) and ...或者select * from 表1 where (code<>2 or code is null) and .... 关于在SQL文中尽量不要用IN 或者OR的求解!!!! 如何处理下面错误, 在查询分析器执行不报错,但在其它应用程序调用出错!ANSI_NULLS and ANSI_WARNINGS options 再问字符串分隔的问题 SQL 语句含有计算式时如何引入变量? 一个SQL批量执行语句大家帮帮忙。。 产品入库时,同时修改库存数量的问题 sql语句运算问题? 字符串中提取数字 同一sql组下有两个实例,如何用作业操作另一个实例的表? 如何批量修改某个字段的值的精确度 SQL裡的VARCHAR類型可以存 中文嗎?(中文前不加N,查詢時要顯示中文出來) int转换为varchar的问题
王 null
李 null
张 1
邓 1
或者
select * from 表1 where (code<>2 or code is null) and ....