Select a.* from
fair_comp a,
(select fair_comp_id ,
row_number() over (patition by fair_comp_id order by fair_comp_id ) row_number
from comp_booth
) b
where a.id = b.fair_comp_id
and b.row_number < 3
[Quote=引用 2 楼 Robin_Ares 的回复:]
Select a.* from
fair_comp a,
(select fair_comp_id ,
row_number() over (patition by fair_comp_id order by fair_comp_id ) row_number
from comp_booth
) b
where a.id = b.fair_comp_id
and b.row_number < 3
[/Quote]
支持