用最高效最简单的sql列出各班成绩最高的列表(List the highest ranked lists in each class with the most efficient and simple SQL).doc
- 1、本文档共26页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
用最高效最简单的sql列出各班成绩最高的列表(List the highest ranked lists in each class with the most efficient and simple SQL)
用最高效最简单的sql列出各班成绩最高的列表(List the highest ranked lists in each class with the most efficient and simple SQL)
1, table: table1 (FId, Fclass, Fscore), with the most efficient and simple SQL list of the highest list of classes, display classes, grades two fields.
Select, fClass, max (fscore), from, table1, group, by, fClass, FID
2, there is a table table1, there are two fields FID, Fno, the word is not empty, write a SQL statement, listed in the table of a FID corresponding to a number of different Fno records.
Class such as:
101a1001
101a1001
102a1002
102a1003
103a1004
104a1005
104a1006
105a1007
105a1007
105a1007
Result:
102a1002
102a1003
104a1005
104a1006
Select t2.* from table1 T1, table1 T2 where t1.fid and t1.fno t2.fno = t2.fid;
3, staff table empinfo
(
Fempno VARCHAR2 (10) not null pk,
Fempname VARCHAR2 (20) not null,
Fage number not null,
Fsalary number not null
);
If the amount of data is about 10 million; write a SQL that you think is the most efficient; use a SQL to calculate the following four types of people:
Fsalary9999, and, Fage 35
Fsalary9999 and Fage 35
Fsalary, 9999, and, Fage 35
Fsalary 9999 and Fage 35
Number of employees per employee;
Select sum (case, when, fsalary 9999, and, Fage 35
Then 1
Else 0end) as fsalary9999_fage35,
Sum (case, when, fsalary 9999, and, Fage, 35
Then 1
Else 0
End) as fsalary9999_fage35,
Sum (case, when, fsalary, 9999, and, Fage 35)
Then 1
Else 0
End) as fsalary9999_fage35,
Sum (case, when, fsalary, 9999, and, Fage, 35)
Then 1
Else 0
End) as fsalary9999_fage35
From empinfo;
4, table A fields are as follows
Month person income
Monthly personnel income
Requires a SQL statement (attention is one) where all (non personnel) monthly and last month and next months total income
Request list output as
In July, the months earnings last month earned income next month
MONTHS PERSON INCOME
------------------------------200807 mantisXF 5000200806 mantisXF2 3500200806 mantisXF3 3000200805 mantisXF1 2000200805 mantisXF6 22002008
您可能关注的文档
- 珠宝首饰与化学 论文(Jewelry and chemical papers).doc
- 珍珠粉的功效(The effect of pearl powder).doc
- 珠江磨刀门整治效果分析(Analysis on renovation effect of Pearl River knife grinding gate).doc
- 班主任与学生沟通的点滴体会(Some experience of communication between class teacher and students).doc
- 班主任工作教训点滴(Class teacher's work, lesson, intravenous drip).doc
- 班主任工作点滴体会【txt文本】_201(The experience of head teacher work [TXT text] _201).doc
- 班委会的组成、组建及工作要求(The composition, form and work requirements of the class committee).doc
- 班主任计划(Class plan).doc
- 班级学风建设中几个基本问题的思考(Reflections on several basic problems in the construction of class atmosphere).doc
- 班得瑞简介(Bandari).doc
- 10《那一年,面包飘香》教案.docx
- 13 花钟 教学设计-2023-2024学年三年级下册语文统编版.docx
- 2024-2025学年中职学校心理健康教育与霸凌预防的设计.docx
- 2024-2025学年中职生反思与行动的反霸凌教学设计.docx
- 2023-2024学年人教版小学数学一年级上册5.docx
- 4.1.1 线段、射线、直线 教学设计 2024-2025学年北师大版七年级数学上册.docx
- 川教版(2024)三年级上册 2.2在线导航选路线 教案.docx
- Unit 8 Dolls (教学设计)-2024-2025学年译林版(三起)英语四年级上册.docx
- 高一上学期体育与健康人教版 “贪吃蛇”耐久跑 教案.docx
- 第1课时 亿以内数的认识(教学设计)-2024-2025学年四年级上册数学人教版.docx
最近下载
- 部编版语文四年级上册第2单元习作《我的家人》教学课件.pptx
- 部编版小学六年级语文上册期末试卷及答案 .pdf VIP
- 注册安全工程师中级化工安全生产专业实务(化工安全类案例)模拟试卷3.doc VIP
- 道德与法治六年级上册第三单元 我们的国家机构 大单元整体学历案教案 教学设计附作业设计(基于新课标教学评一致性).docx
- 中级注册安全工程师考试《安全生产专业实务化工安全》临考模拟卷.docx VIP
- 西子电梯调试维修.pdf
- 票务系统方案.pdf
- 第六单元 阅读综合实践 训练提升教学设计-2024-2025学年统编版语文七年级上册(2024).docx
- 济南华润万象城活动策划.pptx
- T CACM 食管癌前病变治未病干预指南.pdf VIP
文档评论(0)