SQL 查询语句的一个问题 查找 一列中 不包含 什么什么的 语句 怎么写 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @a nvarchar(100)select @a=N'什么什么'select * from tb where 列 not like '%'+@a+'%' 或者 select * from tb where charindex(@a,列)<0 where col!='xxx' --1个值where col not in('xxx1','xxx2') --多个值 not like 或not in not innot likenot exists 这位大姐,你这三个都对,可是格式没有写全呀~,像小弟这种小白还是不知怎么用的~呵呵,谢谢2楼的兄弟提供的这个 select * from tb where 列 not like '%'+@a+'%' 比如 select * from member where id no like '%sdf%' 发2个教程吧SQL中IN,NOT IN,EXISTS,NOT EXISTS的用法和差别http://apps.hi.baidu.com/share/detail/10276644SQL模糊查询LIKE的用法http://edu.codepub.com/2010/0608/23357.php 列中不包括ds这两个字母select * from tableName where colName not like '%ds%' select * from 表名where 列名 like not in(“xx1”,xx2","……",)xx1为多个值中一个 没有like,被人一打扰,写错,不好意思,更正下,如下:select * from 表名where 列名 not in(“xx1”,xx2","……",)xx1为多个值中一个 SELECT *FROM Table1WHERE (title NOT IN ('拉丁神灯', '数学'))SELECT *FROM Table1WHERE (title NOT LIKE '%拉丁神灯') 兼容语句问题 请教一个关于查询的问题 求一个查询语句 SQL查询分析 Sql的查询索引怎么做? 为什么用datediff计算的每一次运行时间都不一样? 如何实现mssql数据库负载均衡 求救!关于ROWNUM的SQL SERVER语法该如何写! ***在存储过程里日期类型的变量转换成字符类型后统计的数据就变少了.不知咋回事呀? [求助]:关于SQL查询语句的一个问题? 怎么跟踪表 sql查询语句咨询(取得表中最大值的一列)
select @a=N'什么什么'select * from tb where 列 not like '%'+@a+'%'
或
not in
not like
not exists
2楼的兄弟提供的这个 select * from tb where 列 not like '%'+@a+'%'
select * from member where id no like '%sdf%'
http://apps.hi.baidu.com/share/detail/10276644SQL模糊查询LIKE的用法
http://edu.codepub.com/2010/0608/23357.php
select * from tableName
where colName not like '%ds%'
where 列名 like not in(“xx1”,xx2","……",)xx1为多个值中一个
select * from 表名
where 列名 not in(“xx1”,xx2","……",)xx1为多个值中一个
FROM Table1
WHERE (title NOT IN ('拉丁神灯', '数学'))
SELECT *
FROM Table1
WHERE (title NOT LIKE '%拉丁神灯')