--转百分比并保留两位小数
select ProfitRate =Convert(nvarchar(20), (Convert(decimal(18,2),((DayPrice -MyPrice)*100/MyPrice))))+'%' from [Stock] where MyPrice>0
update [Stock] set ProfitRate = Convert(nvarchar(20), (Convert(decimal(18,2),((DayPrice -MyPrice)*100/MyPrice))))+'%' where MyPrice>0