SELECT a.*, COUNT(1)FROM ods_bill_food AS aLEFT JOIN manual_food_category AS b ON a.foodName = b.foodNameWHERE b.category = '主食'AND a.reportdate BETWEEN '2023-04-01' AND '2023-04-02' 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b.category = '主食'AND a.reportdate BETWEEN '2023-04-01' AND '2023-04-02'' at line 1 时间: 0.01s
时间: 2024-03-20 09:38:35 浏览: 87
SAS和R语言.rar_R 语言 ppt_r_sas_sas_phyon_r语言
根据你提供的 SQL 语句,错误可能出现在第1行。根据语法提示,可能是因为在第1行中 SELECT 和 FROM 关键字之间缺少空格。正确的写法应该是:
```
SELECT a.*, COUNT(1)
FROM ods_bill_food AS a
LEFT JOIN manual_food_category AS b ON a.foodName = b.foodName
WHERE b.category = '主食'
AND a.reportdate BETWEEN '2023-04-01' AND '2023-04-02';
```
请尝试修改并运行这个 SQL 语句,如果还有问题可以提供更详细的错误信息。
阅读全文