我如何从while循环中获取Column值

时间:2014-07-08 17:01:01

标签: sql while-loop

我如何获得Columns值(TGLEFF) 来自while循环条件中的s​​elect语句?

SELECT
@id=row_number() over (order by JNANGS,TGLEFF asc ),
@JUMTRA=JUMTRA,
@TGLEFF=TGLEFF
from dt_kp_tran where NOMREK='0114800000005' AND JNANGS=2 

set @i=1;

while @i <=48
begin
    PRINT @TGLEFF;
set @i = @i + 1
end

-- PRINT @TGLEFF doesn't give me result

0 个答案:

没有答案