mysql - 过滤掉具有空值的行
问题描述
如何过滤掉具有空值的行?
SELECT country_table.country as country,
(SELECT TRUNCATE(AVG(news_guard_score), 3) FROM news WHERE news.country_id = country_table.country_id) as 'avg_news_score'
FROM country_table
-- WHERE country_table.country_id IS NOT NULL
GROUP BY country;
它不适用于注释代码
我需要它没有最后一行
解决方案
你有没有尝试过:
SELECT country_table.country as country,
(SELECT TRUNCATE(AVG(news_guard_score), 3) FROM news WHERE (news.country_id = country_table.country_id AND country_table.country_id IS NOT NULL)) as 'avg_news_score'
FROM country_table
GROUP BY country;
推荐阅读
- amazon-web-services - 创建基于资源的策略时出错
- oauth-2.0 - 如何将 Identity Server 4 连接到自定义用户数据库并允许代码授权?
- html - 在 svg 中移动“路径”元素
- java - 我如何将频率传递给 soundpool 类中的 (Rate) 参数
- reactjs - 在 Windows 服务器上使用 IIS 进行 React 部署
- html - C# 运算符 \n 用于 HTML 中的字符串不起作用
- git - 将 git 配置为使用 Windows 凭据管理器中的现有凭据
- amazon-web-services - 为什么我在尝试设置安全组 ID 时收到“对未声明资源的引用”错误?
- python-3.x - WSL2 - pip install 需要很长时间(大约 4 分钟才能完成)
- java - 如何从firestore获取字段并更新textview?