编号 课名
a1 语文
a1 数学
a2 office
a3 电脑
a3 数学
a2 电脑
a1 电脑sql該如何呈現資料
课程 学生编号
电脑课 a1
a2
a3
a1 语文
a1 数学
a2 office
a3 电脑
a3 数学
a2 电脑
a1 电脑sql該如何呈現資料
课程 学生编号
电脑课 a1
a2
a3
解决方案 »
- 求助一条SQL语句
- 分区表上的查询问题,哪个方法好啊?
- .net 如何获得oracle中的timestamp格式数据?
- 数据库运行的SQL一定会在v$sql中出现么?
- 问个游标与存储过程的问题
- oracle8i中重启后management serve就不能用了,为何?
- 怎样在pl/sql中得到用户的输入!
- 开了两个SQL Plus,用同样的用户名登录同一个服务器,在一个SQL PLUS中向表写一条数据,用另一个SQL PLUS在同一个表中却找不到数据,为什
- 我是一个计算机新手,想问一个非常简单的问题
- 求救!! Oracel imp 导入程序运用出现如下的错误 , 但是不知道如何调整INITIAL extent for segment in tablespace LOG_DATA ??
- oracle 倒序排序时如何把内容为空的数据放到最后面
- 我电脑上安装了Oracle服务器,之前用的好好的,可是今天不能用了,我看了看服务,监听器没打开,我试了下,可是打不开,求解,俺穷人没什么分,对不住各位了
select 课名 from(
select 课名,count(*) sl from table a group by position order by count(*) desc ) where rownum='1')
额,MAX应该也行,忘了怎么用了,就直接排倒序取第一行了
一直在order by 那边说"遗漏了一个又括弧"
from tb
where 课名=(select 课名 from
(select 课名,count(*) from tb group by 课名 order by count(*) desc) where rownum<2)
with t as
(
select 'a1' bh,'语文' km from dual
union all
select 'a1' bh,'数学' km from dual
union all
select 'a2' bh,'office' km from dual
union all
select 'a3' bh,'电脑' km from dual
union all
select 'a3' bh,'数学' km from dual
union all
select 'a2' bh,'电脑' km from dual
union all
select 'a1' bh,'电脑' km from dual
)
select wmsys.wm_concat(bh) 学员,count(*) 热度 from t group by km
) v order by 热度 desc
create table tb(
a char(10) ,
b char(10)
)
insert into tb
VALUES ('a1' , '语文')
insert into tb
VALUES ('a1' , '数学')
insert into tb
VALUES ('a2' , 'office')
insert into tb
VALUES ('a3' , '电脑')
insert into tb
VALUES ('a3' , '数学')
insert into tb
VALUES ('a2' , '电脑')
insert into tb
VALUES ('a1' , '电脑')select * from tb
where b in (
select top 1 b from tb t2 group by b order by count(b) desc
)
1.在执行时order by的前面总会出现少了括弧
2.rownum = 1→要挑出店选最多次的课程名称如果每个课程都只有一人点选呢??这样会出来吗?