oracle 子查询写法

1

select sub_table.num,sub_table.job_id

from (

select count(*) as num,t.job_id 

from dir_irai t group by t.job_id order by num desc

sub_table where sub_table.num>1

2   

select distinct sub_table.num,t2.job_id,t2.anken_id,t2.client_id

from (

select count(*) as num,t.job_id 

from dir_irai t group by t.job_id order by num desc

) sub_table,dir_irai t2

where sub_table.num>1 and sub_table.job_id=t2.job_id 

order by t2.job_id

posted @ 2010-06-12 16:13  rethink  阅读(1725)  评论(1编辑  收藏  举报