打印本文 打印本文 关闭窗口 关闭窗口
一句T-SQL语句引发的思考
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3678  更新时间:2007/11/14 11:01:33  文章录入:mintao  责任编辑:mintao
stress_test C on  C.id=A.id and B.[k]=C.[key]
where C.id is null)
GO
PRINT ''''第四种语句:''''
select distinct a.id from stress_test a
 where not exists
 ( select * from keytb c
   where not exists
   ( select * from stress_test b
     where
       b.id = a.id
       and
       c.kf1 = b.[key]
   )
 )
GO
PRINT ''''第五种语句:''''
SELECT distinct a.[id] FROM stress_test AS a,stress_test AS b,stress_test AS c,stress_test AS d,stress_test AS e,stress_test AS f
WHERE a.[key]=''''Az'''' AND b.[key]=''''Bw'''' AND c.[key]=''''Cv'''' AND d.[key]=''''Du'''' AND e.[key]=''''Ex'''' AND f.[key]=''''Fy''''
     and a.[id] = b.[id] and a.[id] = c.[id] and a.[id] = d.[id] and a.[id] = e.[id] and a.[id] = f.[id]

GO
SET STATISTICS TIME  OFF
SET STATISTICS IO  OFF

请参考:

http://expert.csdn.net/Expert/topic/2630/2630484.xml?temp=.9921686

 

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口