我有一个疑问:
update product_product
set (write_date, default_code) = (LOCALTIMESTAMP, 'update')
where product_tmpl_id in (
select distinct product_tmpl_id
from product_template
where type='import');
Run Code Online (Sandbox Code Playgroud)
而且需要7个小时才能完成。但是,当我执行子查询时:
select distinct product_tmpl_id
from product_template
where type='import';
Run Code Online (Sandbox Code Playgroud)
我收到错误:
列“product_tmpl_id”不存在
product_tmpl_id
表中没有列product_template
。
这是我的错误。第一个查询应该是:
update product_product set (write_date,default_code) = (LOCALTIMESTAMP,'update')
where product_tmpl_id in
(select distinct id from product_template where type='import');
Run Code Online (Sandbox Code Playgroud)
它只需要几秒钟即可运行。
所以我的问题如下:
结果select version();
是
PostgreSQL 9.4.3 on x86_64-unknown-linux-gnu,
compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit
Run Code Online (Sandbox Code Playgroud)