select * from TableName where 日期 not like '2002%' 或者 select * from tablename where 日期 not in (select 日期 from TableName where not 日期 like '2002%')当然后者的效率就差多了
不好意思,第二句应该是 select * from tablename where 日期 not in (select 日期 from TableName where 日期 like '2002%')
[^] 不属于指定范围 ([a-f]) 或集合 ([abcdef]) 的任何单个字符。 WHERE au_lname LIKE 'de[^l]%' 将查找以 de 开始且其后的字母不为 l 的所有作者的姓氏。
select * from table where convert(char(4),date,112)<>2002
随便啦,呵呵select * from tablename where left(日期,4)<>'2002'
或者
select * from tablename where 日期 not in (select 日期 from TableName where not 日期 like '2002%')当然后者的效率就差多了
select * from tablename where 日期 not in (select 日期 from TableName where 日期 like '2002%')