二十四味凉茶,免费信息发布网站,海南在线
-- 插入数据
insert into test.rate (uname, object, score)
values('aaa', 'chinese', '67'),
('aaa', 'math', '89'),
('aaa', 'physical', '89'),
('bbb', 'chinese', '67'),
('bbb', 'math', '75'),
('bbb', 'physical', '89');
-- 查询
select distinct uname as '姓名',
sum(case object
when 'chinese' then score end) as '语文',
sum(case object
when 'math' then score end) as '数学',
sum(case object
when 'physical' then score end) as '物理' from rate group by uname;
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
小白安装登录mysql-8.0.19-winx64的教程图解(新手必看)
Navicat连接MySQL时报10060、1045错误及my.ini位置问题
网友评论