We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
选出所有 bonus < 1000 员工的 name 及其 bonus
bonus < 1000
name
bonus
create table employee ( empId int, name varchar(255), supervisor int, salary int ); insert into employee values (1, 'John', 3, 1000), (2, 'Dan', 3, 1000), (3, 'Brad', null, 1000), (4, 'Thomas', 3, 1000); create table bonus( empId int, bonus int ); insert into bonus values (2, 500), (4, 2000);
select name, bonus from employee left join bonus on employee.empId = bonus.empId where ifnull(bonus, 0) < 1000;
将 employee 和 bonus 通过 empId 左连,筛选出 bonus 小于 1000 的数据
employee
empId
1000
判断 null 的方法:
null
ifnull()
isnull()
is null
The text was updated successfully, but these errors were encountered:
No branches or pull requests
题目
选出所有
bonus < 1000
员工的name
及其bonus
SQL
解析
将
employee
和bonus
通过empId
左连,筛选出bonus
小于1000
的数据判断
null
的方法:ifnull()
isnull()
is null
The text was updated successfully, but these errors were encountered: