22,209
社区成员
发帖
与我相关
我的任务
分享
SELECT A.* FROM TA A ,TB B WHERE CHARINDEX(B.URL,A.URL)>0
select
*
from
A
where
not exists(select 1 from B where charindex(b.url,a.URL)>0)
select A.url from A
where not exists(select 1 from A,B where A.url like '%B.url%')
select a.* from a where not exists(select 1 from b where charindex(b.url,a.url)>0)
select a.* from a where exists(select 1 from b where charindex(b.url,a.url)=0)
--TRY
SELECT A.* FROM TA A ,TB B WHERE PATINDEX('%'+B.URL+'%',A.URL)=0
declare @talbe_URL table(URL varchar(200))
insert into @talbe_URL select 'http://123aidushu.net'
union all select 'www.an188.com'
union all select 'http://qq123.456.789.com'
union all select 'http://www.aidushu.net'
union all select 'http://022net.com/2008/6-26/42325336273760.html'
union all select 'http://www.56.com'
declare @table_URL_Key table(keyword varchar(50))
insert into @table_URL_Key select 'icafe8.com'
union all select 'qq500.com'
union all select '022net.com'
union all select '56.com'
--select * from @table_URL_Key
select * from @talbe_URL a where not exists
(select * from @table_URL_Key b where charindex(b.keyword,a.url)>0)
/*
http://123aidushu.net
www.an188.com
http://qq123.456.789.com
http://www.aidushu.net
*/
select a.url from a left join b on (charindex(b.url,a.url,0)>0)
where b.url is null
select
*
from
A
where
exists(select 1 from B where charindex(b.url,a.URL)>0)