3

質問があります

WHILE @@fetch_status = 0 
BEGIN   
   SET @message =' ,' + CASE WHEN @year < 10 THEN 'socyr0' ELSE 'socyr' END + CAST(@year AS varchar) + ' as '+ CAST(@sql AS varchar) + ','  
   PRINT @message   
   FETCH NEXT FROM SocioCursor INTO @year
   SET @sql = @sql + 1 
END

結果は次のようないくつかの文字列です

socyr08 as 2006,  
socyr09 as 2007,  
socyr10 as 2008,  
socyr11 as 2009,  
socyr12 as 2010,  

何を変えるべきか

socyr08 as 2006,  
socyr09 as 2007,  
socyr10 as 2008,  
socyr11 as 2009,  
socyr12 as 2010  
4

2 に答える 2