我正在尝试将一些oraclesql转换为mysql,遇到了 WITH oracle中的关键字。有没有等效的 WITH 在mysql中?谢谢 WITH oracle中的示例:
WITH
with cus as (select id from tb_company where id=3) select * from cus;
7lrncoxx1#
是的,自从mysql版本8.0以来,有一个等价的版本:
WITH cte1 AS (SELECT a, b FROM table1), cte2 AS (SELECT c, d FROM table2) SELECT b, d FROM cte1 JOIN cte2 WHERE cte1.a = cte2.c;
https://dev.mysql.com/doc/refman/8.0/en/with.html
1条答案
按热度按时间7lrncoxx1#
是的,自从mysql版本8.0以来,有一个等价的版本:
https://dev.mysql.com/doc/refman/8.0/en/with.html