小编典典

MySQL子查询导致“ where”子句

mysql

是否可以执行这样的mysql查询?

select (select A from B where ... ) as C from D where C like ' ... '

我需要在一般的“ where”子句中使用子查询的结果。


阅读 333

收藏
2020-05-17

共1个答案

小编典典

您可以将其包装在子查询中,如下所示:

SELECT * 
FROM (
        select (select A from B where ... ) as C from D
     ) subq
WHERE 
    C like ' ... '
2020-05-17