PostgreSQL/GREENPLUM关联更新

update a_t AA
set /*AA.*/ sqlstr = 'qqq'
from a_t BB
where aa.id <> BB.id and aa.name = BB.name and BB.time = date'2019-09-09'
and aa.time = date'2019-10-10'

如上,需注意的是set中不能使用别名。

原文地址:https://www.cnblogs.com/lbhqq/p/11753748.html