想了半天就写不出来的一个SQL语句,哎。。。 查询某个表里某个字段中如果包含"x"或"y"或"z"的数据,不删除其余的删除 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --先select确认一下哈--然后delete from tb where col not like '%[xyz]%'try DELETE FROM TB WHERE PATINDEX('%[XYZ]%',COL)=0 declare @t table(col varchar(10))insert @t select 'xaa'insert @t select 'aax'insert @t select 'asd'insert @t select 'aya'insert @t select 'asdzaa'insert @t select '1233'delete @twhere col not like '%[xyz]%'select * from @t/*col----------xaaaaxayaasdzaa(4 個資料列受到影響)*/ delte from formwhere 字段 not in(select * from where 字段 like *x or *y) delte from form where 字段 not in(select 字段 from where 字段 like '%x%' or 字段 LIKE '%y%') delete from tb where col not like '%[xyz]%' delete from tb where parindex('%[xyz]%',co1)=0 delete from tb where patindex('%[xyz]%',co1)=0 请求一句sql的解决方法,急~~~谢谢了 连接查询的语句 导入数据问题!高手进!!贴分!!! 问一个自动编号问题 数据统计sql 请问我有一个系统,里面数据很庞大,我想把他分成几个数据库存储数据!这样对性能会有所增加吗? ms2000与ms2005的bit类型 触发器,能根据某一个时间进行修数据库嘛?????? select语句,2表操作。~~~~~~~~ 算法请教 类型不匹配??? 表为什么总有最后一行null
--然后delete from tb where col not like '%[xyz]%'try
insert @t select 'xaa'
insert @t select 'aax'
insert @t select 'asd'
insert @t select 'aya'
insert @t select 'asdzaa'
insert @t select '1233'
delete @t
where col not like '%[xyz]%'
select * from @t
/*
col
----------
xaa
aax
aya
asdzaa(4 個資料列受到影響)
*/
where 字段 not in(select * from where 字段 like *x or *y)
where 字段 not in(select 字段 from where 字段 like '%x%' or 字段 LIKE '%y%')