原表结构

在oracle中将某个字段的数据作为列名的查询

查询语句:
select sno,sname,sum(语文) 语文,sum(数学) 数学,sum(英语) 英语 from (select sno,sname,decode(subjiect,'语文',grade) 语文,decode(subjiect,'数学',grade) 数学,decode(subjiect,'英语',grade) 英语 from MYOBJECT)
group by sno,sname
 
查询结果
在oracle中将某个字段的数据作为列名的查询

 

相关文章:

  • 2021-06-06
  • 2021-12-10
  • 2021-09-24
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
猜你喜欢
  • 2021-11-03
  • 2021-10-27
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案