--轉百分比並保留兩位小數
select ProfitRate =Convert(nvarchar(20), (Convert(decimal(18,2),((DayPrice -MyPrice)*100/MyPrice))))+'%' from [Stock] where MyPrice>0ci
update [Stock] set ProfitRate = Convert(nvarchar(20), (Convert(decimal(18,2),((DayPrice -MyPrice)*100/MyPrice))))+'%' where MyPrice>0it