In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "how to solve the Mysql multi-line subquery use and null value problem", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "how to solve the Mysql multi-line subquery use and null problem" it!
1 definition
Also known as set comparison subquery
Internal query returns multiple rows
Use the multiline comparison operator
2 multiline comparison operator
-- multiple subqueries-- INSELECT employee_id, manager_id, department_id FROM employees WHERE manager_id IN (--look for the same manager_id in the returned set SELECT manager_id FROM employees WHERE employee_id IN (141,147)) -- ANY# question: returns the employee number, name, job_id and salary last_name, job_id, salary job_id! = 'IT_PROG' AND salary of any employee in the job_id whose salary is lower than that of job_id in the' IT_PROG' department.
< ANY ( -- 比任意一个小都可以 SELECT salary FROM employees WHERE job_id = 'IT_PROG' );-- ALL#题目:返回其它job_id中比job_id为'IT_PROG'部门所有工资低的员工的员工号、姓名、job_id 以及salary AND salary < ALL ( -- 比所有的都小才可以3 空值问题3.1 问题 -- 空值问题SELECT last_name FROM employees WHERE employee_id NOT IN ( SELECT -- 子查询中的结果有NULL manager_id employees) 子查询的结果:Query results:
3.2 Resolution
Just remove the NULL from the subquery
-- Null value problem solving SELECT last_name FROM employees WHERE employee_id NOT IN (SELECT manager_id FROM employees manager_id IS NOT NULL)
Subquery removes NULL:
Query results:
Thank you for your reading, the above is the content of "how to solve the use of Mysql multi-line subquery and null value problem". After the study of this article, I believe you have a deeper understanding of how to solve the problem of Mysql multi-line subquery use and null value problem, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.