思路:使用WHERE
关键字添加限定条件,并且注意用 !=
符号过滤掉年龄为空的用户
代码解释:从表user_profile
中取出列device_id
、gender
、age
、university
,并排除年龄为空的用户
SELECT
device_id,
gender,
age,
university
FROM
user_profile
WHERE
age != 'NULL'
题目:https://www.nowcoder.com/practice/08c9846a423540319eea4be44e339e35?tpId=199&tqId=1971605&ru=/exam/oj&qru=/ta/sql-quick-study/question-ranking&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3DSQL%25E7%25AF%2587%26topicId%3D199
标签:profile,university,age,空值,SQL10,user,为空,where,id
来源: https://www.cnblogs.com/tiansz/p/16464641.html