- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Errors with Subqueries One common error with subqueries is more than one row returned for a single-row subquery. In the SQL statement on the slide, the subquery contains a GROUP BY clause, which implies that the subquery will return multiple rows, one for each group it finds. In this case, the result of the subquery will be 4400, 6000, 2500, 4200, 7000, 17000, and 8300. The outer query takes the results of the subquery (4400, 6000, 2500, 4200, 7000, 17000, 8300) and uses these results in its WHERE clause. The WHERE clause contains an equal (=) operator, a single-row comparison operator expecting only one value. The = operator cannot accept more than one value from the subquery and therefore generates the error. To correct this error, change the = operator to IN. Problems with Subqueries A common problem with subqueries is no rows being returned by the inner query. In the SQL statement on the slide, the subquery contains a WHERE clause. Presumably, the intention is to find the employee whose name is Haas. The statement is correct but selects no rows when executed. There is no employee named Haas. So the subquery returns no rows. The outer query takes the results of the subquery (null) and uses these results in its WHERE clause. The outer query finds no employee with a job ID equal to null, and so returns no rows. If a job existed with a value of null, the row is not returned because comparison of two null values yields a null, therefore the WHERE condition is not true. Multiple-Row Subqueries Subqueries that return more than one row are called multiple-row subqueries. You use a multiple-row operator, instead of a single-row operator, with a multiple-row subquery. The multiple-row operator expects one or more values. SELECT last_name, salary, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id); Example Find the employees who earn the same salary as
您可能关注的文档
- 九年度级数学上册 6.4池塘里有多少条鱼课件 北师大版.ppt
- 大学英语1期末考试考前辅导.ppt
- 052 对多处文本格式进行统一设置.pptx
- 06 урок.ppt
- 第七篇 中国古代其它珍贵文物.ppt
- ch5_变电站微机故障录波.ppt
- 古代历史(先秦).doc
- 山居秋暝简化本.ppt
- 唯美图文辑五.doc
- 武科大流体力学习题答案201108-附件.doc
- 2025文科综合高考上海市真题和答案.docx
- 2025年江西省专升本大学语文考试试题及答案.docx
- 职业生涯规划与管理智慧.pptx
- 31.新形势下进一步做好工业控制系统网络安全防护工作方案 conv.docx
- 四川省成都市蒲江县2025-2026学年高一上学期第一次月考地理试题.docx
- 广东省阳江市部分学校2024-2025学年高二上学期期末联考地理试题.docx
- 2025年江西省上饶市中小学教师招聘考试试题解析及答案.docx
- 2025文科综合高考江苏真题试卷+参考答案.docx
- 2025文科综合高考江西考试真题及答案.docx
- 四川省成都市新都区2025-2026学年高一上学期10月阶段性检测地理试题.docx
最近下载
- CJJ61-2017 城市地下管线探测技术规程.docx VIP
- 建筑工程招标文件模板模板.doc VIP
- CJJT-269-2017-城市综合地下管线信息系统技术规范.pdf VIP
- 1_1_2021年第四季度护理安全管理.pptx VIP
- 培训机构教务年度工作总结.pptx VIP
- T_CSGPC 027-2024 地下市政基础设施 综合管理信息平台建设技术规范.docx VIP
- 子宫内膜息肉(宫腔镜子宫病损切除术)临床路径【2020版】(1).pdf VIP
- 艺术类院校课程建设工作计划.docx VIP
- 小微企业安全生产标准化管理体系要求编制说明.pdf VIP
- 吴在望生化九大代谢图(局解).pdf VIP
原创力文档


文档评论(0)