急求一条SQL语句,与某糊查询相关 (100分)

  • 主题发起人 主题发起人 hjy2000
  • 开始时间 开始时间
H

hjy2000

Unregistered / Unconfirmed
GUEST, unregistred user!
要求得到这样的数据集
NAME字段中以“A”到“Z”打头的值,且不包括“ABC”到“ABQ”,“B”,“EE”打头的值
谢谢
 
name like [a-z]% and name not in ("abc","b","ee")
 
不包括中要求"ABC"致"ABQ",且是左打头的,上面语句不行
 
select * from TableName where Name like '[A-Z]%'
and Name not in (Select Name from TableName where Name Like '[ABC-ABQ]%'or Name Like 'B%'
or Name Like 'EE%')
 
to:xgpxf
我是DELPHI 5 用ADO 对ACCESS97操作,这种嵌套好象不行,还有其他方法吗?

 
select * from 表名
where (Name like "[A-Z]*")
and (Name not like "AB[C-Q]*")
and (Name not like "B*")
and (Name not like "EE*")
order by Name
 
同意yntw!
 
select * into #table_tmp from table where name like '[A-Z]%'
seledt * from #table_tmp where (Name not like 'AB[C-Q]*') and (Name not like 'B%') and (Name not like 'EE%')
drop table #table_tmp
 
谢谢各位
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
637
import
I
后退
顶部