SELECT a.project_name AS projectName, a.order_no AS orderNo, workHourPlan AS workHourPlan FROM t_project_plan_management a WHERE a.reserve3 != '1' workHourPlan IN ( SELECT SUM(TRUNCATE( b.work_hour , 2 ) ) FROM t_work_hour b WHERE b.order_no = a.order_no )错在哪
时间: 2024-03-21 14:38:26 浏览: 123
vue.js 实现a标签href里添加参数
在这个 SQL 语句中,您的 WHERE 子句中缺少一个逻辑运算符。应该在 `a.reserve3 != '1'` 之后添加 `AND` 连接符。
这是修改后的 SQL 语句:
```
SELECT
a.project_name AS projectName,
a.order_no AS orderNo,
workHourPlan AS workHourPlan
FROM
t_project_plan_management a
WHERE
a.reserve3 != '1'
AND workHourPlan IN (
SELECT
SUM(TRUNCATE(b.work_hour, 2))
FROM
t_work_hour b
WHERE
b.order_no = a.order_no
)
```
这样修改后,SQL 语句就可以正确执行了。
阅读全文