SQL10、用where过滤空值练习


思路:使用WHERE关键字添加限定条件,并且注意用 !=符号过滤掉年龄为空的用户

代码解释:从表user_profile中取出列device_idgenderageuniversity,并排除年龄为空的用户

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

原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/273553.html

(0)
上一篇 2022年7月11日
下一篇 2022年7月11日

相关推荐

发表回复

登录后才能评论