What a fuck postgre update sql

Source: Internet
Author: User

================= What a fuck postgre update sql =================

UPDATE temp_group_temp set group_id=c.group_id from temp_group_view_2000 C where
temp_group_temp. User_id=cast (c.user_id as bigint);

================= What a fuck postgre update sql =================

Because of the wrong reasons, so I have to go back today, want to use Postgre to update the field from one table to another table, using aliases, always say that the alias is associated with the table does not exist.

Toss (what degree Niang, Google, key can find things or be blocked, nausea) for one hours, no fruit.

Helpless, think of a manual update statement, but think of the convenience of Oracle, thought, there is no way to automate the implementation of the method.

Finally, try to use the table name instead of the alias, and the result is successful.

Write this to commemorate the one hours wasted by the PostgreSQL update alias, and hope that people who meet the same situation will save time by seeing this.

In fact, I like Oracle very much.

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.