oracle环境select workflow_requestbase.requestname,
       workflow_requestbase.requestid,
       workflow_requestbase.workflowid,
       workflow_requestbase.creater,
       workflow_requestbase.createdate,
       workflow_currentoperator.receivedate  from workflow_requestbase
 where exists (select 1
          from workflow_currentoperator
         where requestid = workflow_requestbase.requestid) 
   and status is not null
   and workflow_requestbase.workflowid > 1
 order by createdate desc
现在 问题就在红色的标记哪里, 我想得到workflow_currentoperator里的某一个字段 怎么写?
其他的地方 都没问题,望高人 指点。感谢不尽!

解决方案 »

  1.   

    select workflow_requestbase.requestname,
      workflow_requestbase.requestid,
      workflow_requestbase.workflowid,
      workflow_requestbase.creater,
      workflow_requestbase.createdate,
      workflow_currentoperator.receivedate from workflow_requestbase,workflow_currentoperator
     where exists (select 1
      from workflow_currentoperator
      where requestid = workflow_requestbase.requestid)  
      and status is not null
      and workflow_requestbase.workflowid > 1
     order by createdate desc
      

  2.   

    select workflow_requestbase.requestname,
      workflow_requestbase.requestid,
      workflow_requestbase.workflowid,
      workflow_requestbase.creater,
      workflow_requestbase.createdate,
      (SELECT max(receivedate) FROM workflow_currentoperator WHERE workflow_currentoperator.requestid = workflow_requestbase.requestid)
      
       from workflow_requestbase 
     where exists (select 1
      from workflow_currentoperator
      where requestid = workflow_requestbase.requestid)  
      and status is not null
      and workflow_requestbase.workflowid > 1
     order by createdate desc
      

  3.   

    你这两个表的关联字段是啥啊?没有关联字段 怎么可能不慢呢?
    假设第一个表10万数据,第二个表5万,那么你这样查,结果就是10万*5万 50亿啊 不慢才怪
    你在where里要加一个两个表的关联
    或者像楼上那样也行