如下一个sql语句,怎么分析是怎么进行关联的,unid是doc表的字段,看样子了unid做条件传进去,但是里面有多个子查询,一下子就高的很迷糊了
SELECT documents.*, (select 1 from dual) status FROM doc where exists (select 1 from ACL a left join ow o on a.ownerid=o.id whEre unid=a.WORKID and ((a.OWNERID = '*' and not exists (select 1 from doc_read wheRe unid=doc_read.docid and (readerid = '2c9186830dbefd07010dc9cb2b420144')) and not exists (select 1 from DOC_DELETE d wheRe unid=d.docid and (d.ownerid = '2c9186830dbefd07010dc9cb2b420144') and d.type='shou') ) or (o.flag=1 and a.OWNERID in ('2c9186830dbefd07010dc9cb2b420144') and not exists (select 1 from doc_read wheRe unid=doc_read.docid and (readerid = '2c9186830dbefd07010dc9cb2b420144')) and not exists (select 1 from DOC_DELETE d wheRe unid=d.docid and (d.ownerid = '2c9186830dbefd07010dc9cb2b420144') and d.type='shou') )))
墨值悬赏

评论
