sql - Need help Inner join and where condition
问题描述
I don't know why below codes did not work.
Problem: Using INNER JOIN
, find the minimum “Average Student Attendance” for a community is where hardship is 96
SELECT b.Community_Area_Name, min(b.Average_Student_Attendance) FROM CENSUS_DATA as a
INNER JOIN CHICAGO_PUBLIC_SCHOOLS as b
ON a.Community_Area_Number =b.Community_Area_Number
WHERE a.hardship_index=96
GROUP BY b.Community_Area_Name
Error in jupyter notebook:
File "", line 2 INNER JOIN CHICAGO_PUBLIC_SCHOOLS as b ^ SyntaxError: invalid syntax
Error in SQL server:
"A.COMMUNITY_AREA_NUMBER" is not valid in the context where it is used.. SQLCODE=-206, SQLSTATE=42703, DRIVER=4.22.36
解决方案
我也有同样的问题。我设法做到了。该问题在文章“使用真实数据集”第 4 周中进行了描述。我们需要在查询中使用双引号。像这样的东西
SELECT MIN("Average_Student_Attendance")
推荐阅读
- java - 定时器任务仅在 Spring Boot 中服务器重启后运行
- vba - 将 Access 表单中的 DefaultValue 设置为表的最后一条记录
- python - 句子比较:如何突出差异
- oracle - PLS-00103:尝试使用序列递增值时遇到符号 DECLARE/EOF
- python - python电报bot api inlinekeyboardbutton没有得到callback_data
- c# - 使用 xslt 模板将多个图像添加到 docx 文件
- dart - Dart 将类型传递给函数失败
- xamarin - 在 Fabulous (F#) UWP 应用程序中使用 Xamarin Essentials 文件选择器
- amazon-web-services - Route 53 域不会指向 AWS Lightsail 实例
- java - 如何使用 .war 文件将我的 wildfly 21 Rest API 部署到 heroku