About SELECT .... For update of [fields] usage

Source: Internet
Author: User
If the SELECT statement uses Alias, DISTINCT operator, CURSORExpression, SET (union, union all, minus, intersect) operators, Group_by_clause, Or aggregate (count, max, mix, avg) fungate, the query return value cannot be updated; eg: TABLE: emp id name salary ==================== 10 aaaa 123413 abcd 231315 cdue 1245... ...... case 1> use an alias; select id emp_id, name emp_name, salary emp_salaryfrom empwhere id = 10for update; -- this means that the update cannot be achieved; you can change it to select id emp_id, name emp_name, salary from empwhere id = 10for update of salary -- update the salary field;

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.