1. 程式人生 > >oracle兩表聯查,分組統計

oracle兩表聯查,分組統計

select f.f_id, f.f_time, f.formulanm, f.formula, f.formula_desc,count(p.f_pid) as total from b_formula f
left join b_parameter p 
on f.f_id = p.f_pid  where f.formulanm like '%%' 
group by f.f_id, f.f_time, f.formulanm, f.formula, f.formula_desc order by f.f_time desc
group by 跟上所有要顯示的欄位即可