У меня есть следующий запрос:
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
)
);
Для того, чтобы применить конкретное условие, проверьте здесь для получения более подробной информации, проблема в том, что PhpMyAdmin, кажется, не может распознать оператор with
,Фактически я получаю:
Нераспознанный тип оператора.(около «с» в позиции 0)
Что я могу сделать?