扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:iTbulo.COM 来源:iTbulo.COM 2007年9月15日
关键字: 存储过程 SQL Server SQL Server 各版本 数据库
INSERT INTO #tmp1 (tmp1_name)
SELECT DISTINCT b.[name] FROM t a,t b WHERE a.[name] = @CurrenName AND b.lid = a.lid AND b.[name] <> @CurrenName
INSERT INTO #tmp (tmp_name)
select d.[tmp1_name] from t a,t b,t c, #tmp1 d where
a.lid=b.lid and a.[type]=b.[type] and a.id and c.id>=a.id and c.id<=b.id
IF @@rowcount>0 BEGIN
select distinct c.* from t a,t b,t c,#tmp d where
a.lid=b.lid and a.[type]=b.[type] and a.id and c.id>=a.id and c.id<=b.id order by c.id
select distinct c.* from t a,t b,t c,#tmp d where
a.lid=b.lid and a.[type]=b.[type] and a.id and c.id>=a.id and c.id<=b.id order by c.id
END
--SELECT * FROM #tmp
end
drop table #result
drop table #tmp1
drop table #tmp
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
exec search '文一路口','总管塘'
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。