declare prioritaC INT default 1;
select
case
when (b.zraneni = 0 and a.center_id is not null) then (
a.center_id
) else (
select hokejista_id
from nahradnik
where nahradnikTyp_id = 3 and tym_id = 1 and priorita = prioritaC
set prioritaC = prioritaC + 1;
)
end as center_id_real
from oslabeni45 a
left join hokejista b on (a.center_id = b.id)
명세서가 성명이 아닌 경우 set prioritaC = prioritaC + 1
을 사용할 수없는 이유는 무엇입니까? 선택에서 변수 증분은 어떻게 될 수 있습니까?내부에서 업데이트 변수가있는 MySql 프로 시저
업데이트 문에서 행 값을 증가시켜야합니다! –
업데이트 문에서 변수를 어떻게 증가시킬 수 있습니까? –