我需要在一行中運行這個四倍我怎麼能做到這一點,也可以少線我該如何縮短這個SQL?
update opp set run_mode = 0, run_time = 0,
where oppar_job_name in ('ABC')) and oppar_job_rec in ('ABC');
update opp set run_mode = 0, run_time = 0,
where oppar_job_name in ('DEF')) and oppar_job_rec in ('DEF');
update opp set run_mode = 0, run_time = 0,
where oppar_job_name in ('FGH')) and oppar_job_rec in ('FGH');
update opp set run_mode = 0, run_time = 0,
where oppar_job_name in ('IJK')) and oppar_job_rec in ('IJK');
我想嘗試這一點。
update opp set run_mode = 0, run_time = 0,
where oppar_job_name in (
'ABC',
'DEF',
'FGH',
'IJK'
) and oppar_job_rec in
(
'ABC',
'DEF',
'FGH',
'IJK'
);
以上是正確的事情。 我的意思是有一一對應的表像
ABC ABC
DEF DEF
FGH FGH
IJK IJK
你縮短SQL也會影響其ABC DEF,ABC FGH,ABC IJK,行..等 – Jayy 2012-02-16 13:24:45
@ KaipaMSarma沒有,因爲他說這兩列之間有一對一的對應關係。 – Behrang 2012-02-16 13:29:44