2022年9月12日
摘要: 在Oracle11g的几个版本中,企业版安装的选项比较全面,所以这里选用企业版安装。 一、安装前的准备 1. 在官网下载Oracle11g的安装包。 (官方下载地址为:https://www.oracle.com/database/technologies/oracle-database-softw 阅读全文
posted @ 2022-09-12 18:25 洞幺人生 阅读(14273) 评论(0) 推荐(1) 编辑
摘要: select a.sname,max(a.语文) yuwen,max(a.数学) shuxue from (select sname, case kemu when '语文' then fenshu else 0 end 语文, case kemu when '数学' then fenshu els 阅读全文
posted @ 2022-09-12 16:04 洞幺人生 阅读(755) 评论(0) 推荐(0) 编辑
摘要: pivot 运算符使用首先我们创建测试表,并且插入相应的数据 create table pivotDemo( id int not null, subjects char(20) not null, score int not null ) insert into pivotDemo values( 阅读全文
posted @ 2022-09-12 14:37 洞幺人生 阅读(1996) 评论(0) 推荐(0) 编辑
摘要: pivot 可以把列值转换为输出中的多个列。 pivot 可以在其他剩余的列的值上执行聚合函数。 unpivot 将列转换为列值 语法 SELECT <non-pivoted column>, [first pivoted column] AS <column name>, [second pivo 阅读全文
posted @ 2022-09-12 14:32 洞幺人生 阅读(261) 评论(0) 推荐(0) 编辑
摘要: select c.score,sum(c.ccount)from (select b.n ,b.score,count(1) ccount from (select unpriots.n,unpriots.score from (select cdate,n1,n2,n3,n4,n5,n6,n7,n 阅读全文
posted @ 2022-09-12 13:40 洞幺人生 阅读(411) 评论(0) 推荐(0) 编辑