嗨,這是我在mysql中使用的代碼,它的工作正常..是否有任何方法可以爲GRP聲明一個變量並在代碼中調用它。這樣我就可以再次使用的代碼,如果我必須做的比玻璃鋼和其他任何名稱等一些列的數學,因爲名字不斷改變所有的時間存儲過程使用參數調用特定的列
SELECT GRP,
@_11:=power(GRP,0.1)+0.1*@_11 AS GRP_11 ,
@_12:=power(GRP,0.2)+0.1*@_12 AS GRP_12 ,
@_13:=power(GRP,0.3)+0.1*@_13 AS GRP_13 ,
@_14:=power(GRP,0.4)+0.1*@_14 AS GRP_14 ,
@_15:=power(GRP,0.5)+0.1*@_15 AS GRP_15 ,
@_16:=power(GRP,0.6)+0.1*@_16 AS GRP_16 ,
@_17:=power(GRP,0.7)+0.1*@_17 AS San_Orange_CS_GRP_17 ,
@_18:=power(GRP,0.8)+0.1*@_18 AS GRP_18 ,
@_19:=power(GRP,0.9)+0.1*@_19 AS GRP_19 ,
from DUMMY JOIN (SELECT @_11:=0,@_12:=0,@_13:=0,@_14:=0,@_15:=0,@_16:=0,
@_17:=0,@_18:=0,@_19:=0) t;
在此先感謝...
您可以使用像'選擇@grp:= GRP爲GRP,@ _11:=功率(@grp, 0.1)+0.1 * @ _ 11 AS GRP_11,...' –
感謝它的工作 – user3571489
@Ravinder那麼AS GRP_11呢?有可能在那裏改變GRP嗎? – user3571489