日期:2014-05-18 浏览次数:20499 次
DECLARE @A TABLE (A CHAR,B CHAR,C INT) INSERT INTO @A(A,B,C) SELECT 'a','b',3 UNION ALL SELECT 'c','d',2 UNION ALL SELECT 'e','f',4 SELECT A,B,1 FROM @A a JOIN [master].dbo.spt_values b ON 1=1 WHERE b.[type] = 'P' AND b.number < a.C A B ---- ---- ----------- a b 1 a b 1 a b 1 c d 1 c d 1 e f 1 e f 1 e f 1 e f 1 (9 行受影响)