MySQL Statement related issues

Source: Internet
Author: User
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?
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.