1
時,如何循環一個案例我有名爲col1,col2的列到col12,我有exm1,exm2到exm12。當條件爲
我該怎麼做?
declare @i= 1
do until i=12
(
case
when [email protected] <= 25000 then '1. xxxx <= 25K '
when [email protected] > 25000 and [email protected] <=100000 then '2. 25K < xxxx <= 100K '
when [email protected] > 100000 then '6. xxxx >= 100K '
else end as [email protected]
set i=i+1
)
同樣與EXM1
哪個DBMS您正在使用?SQL服務器? –
是的SQL Server。 –