34,590
社区成员
发帖
与我相关
我的任务
分享
id gm name lv A B
15 1 test 2 100 100
-----------------------------------------
直接把这个结果按百分比输出:
create table yu(id int,gm int,name varchar(10),lv int,A int,B int)
insert into yu select 15, 1 , 'test' , 2 , 100 , 100
select a=ltrim(cast(a*100.0/(a+b) as numeric(5,2)))+'%',
b=ltrim(cast(b*100.0/(a+b) as numeric(5,2)))+'%'
from yu