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
查找推荐人的编号不是 2
2
create table customer( id int, name varchar(255), referee_id int ); insert into customer values (1, 'Will', null), (2, 'Jane', null), (3, 'Alex', 2), (4, 'Bill', null), (5, 'Zack', 1), (6, 'Mark', 2);
select name from customer where ifnull(referee_id, 0) != 2 or referee_id != 2;
这题的主要考点在于 SQL 中判断 null 的方法
null
判断 referee_id 是 null 的方法:
referee_id
is null
isnull()
ifnull()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
题目
查找推荐人的编号不是
2
SQL
解析
这题的主要考点在于 SQL 中判断
null
的方法判断
referee_id
是null
的方法:is null
isnull()
ifnull()
The text was updated successfully, but these errors were encountered: