Nee*_*ain 1 mysql sql common-table-expression
所以我有类似的要求
WITH customers_in_usa AS (
SELECT
customerName, state
FROM
customers
WHERE
country = 'USA'
) SELECT
customerName
FROM
customers_in_usa
WHERE
state = 'CA'
ORDER BY customerName;
Run Code Online (Sandbox Code Playgroud)
但是在写入时我发现了一个错误:'WITH在此位置无效输入' error_picture.你能帮我理解这段代码中的错误吗?
WITH customers_in_usa AS现在是无效的MySQL代码.MySQL将在MySQL版本8中支持CTE.
您可以重写SQL代码,这应该给出相同的结果.
SELECT
customerName
, state
FROM
customers
WHERE
country = 'USA'
AND
state = 'CA'
ORDER BY
customerName
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11688 次 |
| 最近记录: |