SQL 查询,无法识别 '('select

时间:2021-07-30 10:58:56

标签: sql subquery

select * 
from TABLE_A 
where ID = (select ID 
            from TABLE_B as b 
            inner join TABLE_C as c on b.id = c.id 
            where b.date = "2021-10-31");

无法识别 '(' 'select' 'ID' 附近的输入

1 个答案:

答案 0 :(得分:0)

您的查询中有更正。

由于内部选择查询将返回 Id 的集合,因此您需要使用 'in' 关键字而不是 '='。

修改后,您的查询应如下所示:

select * from TABLE_A where ID in (select ID from TABLE_B as b inner join TABLE_C as c on b.id = c.id where b.date = "2021-10-31");