what a fuck postgre update sql

================= 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 =================

因为做错的缘故,所以 今天不得不回退,想用postgre 从一个表更新字段到另一个表, 使用用别名后,老是说别名所关联的表不存在。 

折腾(什么度娘,谷哥,关键能查到的东西还是被blocked,恶心)了一个小时,无果。

万般无奈之下,想到一条条手工的update语句,可是想想Oracle 的便利,心想,不可能没有自动执行的方法。

最后,试着不用别名,直接用表名来替代,结果成功了。

写这篇,来纪念因 postgreSQL update 别名而浪费的一个多小时,希望遇到同样情况的人能因为看到这个而节省时间。

其实我是很喜欢ORACLE地.

原文地址:https://www.cnblogs.com/rojas/p/3829739.html