删除为其提取ctid的所有行

时间:2014-09-11 12:01:21

标签: sql postgresql psql

我需要删除使用连接查询

获取ctid的所有行

我用来获取多行的查询

每行返回4个ctid。

我需要从表格中删除每一行的所有4行

我提取ctid的查询是==>

select 
  t1.ctid, 
  t2.ctid, 
  t3.ctid, 
  t4.ctid 
from 
  auditrtailreference t1
LEFT JOIN auditrtailreference t2 
  on t2.sourceid = t1.destinationid 
  AND t2.event ='80' 
  AND t2.innodename like '%_SFTP'
LEFT JOIN auditrtailreference t3 
  on t3.sourceid = t2.destinationid 
  AND t3.event ='68'
LEFT JOIN auditrtailreference t4 
  on t4.sourceid = t1.destinationid 
  AND t4.event ='73'
where t1.event ='67' 
  and t1.innodename like '%_SFTP' 
  and t3.destinationid like '%' 
  and t1.outtime >= '2014/09/10 00:00' 
  and t1.outtime <= '2014/09/11 15:24' 
  AND t3.outnodename like '%init_Dist' 
  AND t3.destinationid like '%my%'

但由于每行返回4列,我不能在子句

中使用

请帮助我

此致

Khanjarrr

0 个答案:

没有答案