I have the following query:
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
)
);
Which essentially apply specific condition, check here for more details, the problem’s that PhpMyAdmin seems not able to recognize with
operator, infact I get:
Unrecognized statement type. (near “with” at position 0)
What can I do?
2
Answers
That’s because there is no
with
operator in mysql.Use valid syntax
You can try below –