SQL10、用where过滤空值练习
思路:使用WHERE
关键字添加限定条件,并且注意用 !=
符号过滤掉年龄为空的用户
代码解释:从表user_profile
中取出列device_id
、gender
、age
、university
,并排除年龄为空的用户
SELECT
device_id,
gender,
age,
university
FROM
user_profile
WHERE
age != 'NULL'
思路:使用WHERE
关键字添加限定条件,并且注意用 !=
符号过滤掉年龄为空的用户
代码解释:从表user_profile
中取出列device_id
、gender
、age
、university
,并排除年龄为空的用户
SELECT
device_id,
gender,
age,
university
FROM
user_profile
WHERE
age != 'NULL'