【发布时间】:2019-08-20 07:20:05
【问题描述】:
我有以下疑问:
with current_round as (
select *
from match_case_1
where round_id = 12696
)
select *
from current_round cr
where
(
not exists(select * from current_round where gameweek is null)
)
or
(
exists(select * from current_round where status = 1)
and not exists(select * from current_round where gameweek is not null)
and cr.status = 1
)
or
(
not exists(select * from current_round where status = 1)
and not exists(select * from current_round where gameweek is not null)
and cast(cr.`datetime` as date) = (
select max(cast(`datetime` as date)) as `date`
from current_round
where status = 5 or status = 3
)
);
这基本上适用于特定条件,请查看 here 了解更多详细信息,问题在于 PhpMyAdmin 似乎无法识别 with 运算符,事实上我明白了:
无法识别的语句类型。 (在位置 0 的“with”附近)
我能做什么?
【问题讨论】:
-
这可能会解决你的问题[stackoverflow.com/questions/51759466/…
-
@SurajSingh 说找不到页面
-
@SurajSingh,它在小提琴中工作,因为您选择了 mysql 版本 8,但它在较低版本中不可用
-
@sfarzoso 。 . .如果您想使用 CTE,请升级到 MySQL 8+。
-
@GordonLinoff 我现在更新到最新版本的 MSQL,我得到:
Error processing request Error code: 500 Error message: Internal Server Error当我粘贴上面的查询时,PhpMyAdmin 返回此错误
标签: mysql sql phpmyadmin