题解 | #用where过滤空值练习#

用where过滤空值练习

https://www.nowcoder.com/practice/08c9846a423540319eea4be44e339e35

题目分析

我们需要从 user_profile 表中选择 device_idgenderageuniversity 列,并且只返回 age 不为空的记录。

SQL 查询

以下是实现上述思路的 SQL 查询:

SELECT device_id, gender, age, university
FROM user_profile
WHERE age IS NOT NULL;

解释

  • SELECT device_id, gender, age, university: 选择 device_idgenderageuniversity 列。
  • FROM user_profile: 从 user_profile 表中获取数据。
  • WHERE age IS NOT NULL: 只返回 age 不为空的记录。
全部评论

相关推荐

10-13 13:49
南京大学 财务
饿魔:笑死我了,你简直是个天才
点赞 评论 收藏
分享
评论
6
3
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务