ITeye博客

oracle 子查询写法

#rethink# · 2010-06-12 16:13 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。