MySQL statement problem?
SQL Code
UPDATE (SELECT workid,wk. Ppjid,wd. Checkuppoint,wd. Adjustpoint,wd. Factpoint, WE. Isspecial, WK. Worktype, WK. Workstatus from "work" WK left JOIN workdesign WD on WK. Workid=wd. Work_idleft JOIN Workeditiondot we on We. Editiondotid=we. Editiondotid WHERE ' WK '. WorkID in (SELECT ' W '). WorkID from ' work ' W WHERE w.ppjid=18035 and (' W '). Workstatus= ' has been issued ' OR ' W '. workstatus= ' finalized '))) SET WD. Checkuppoint=wd. Adjustpoint+wd. Factpoint WHERE WK. ppjid=18035
Every derived table must with its own alias how to resolve (alias problem)?
------Solution--------------------
Every derived table must has its own alias
Each derived table must have its own alias
UPDATE
(
SELECT WorkID,
Wk. Ppjid,
Wd. Checkuppoint,
Wd. Adjustpoint,
Wd. Factpoint,
WE. Isspecial,
Wk. Worktype,
Wk. Workstatus
From "work" WK left JOIN workdesign WD on WK. Workid=wd. work_id
Left joins Workeditiondot we on We. Editiondotid=we. Editiondotid WHERE ' WK '. WorkID in
(SELECT ' W '). WorkID from ' work ' W WHERE w.ppjid=18035 and (' W '). Workstatus= ' has been issued ' OR ' W '. workstatus= ' finalized ')))
SET WD. Checkuppoint=wd. Adjustpoint+wd. Factpoint WHERE WK. ppjid=18035
The red part is a derived table and requires an alias
Modified is the query results, you can modify the success of this?