17,140
社区成员




select *
from TABNAME t
where (select count(1)
from TABNAME
where text1 = t.text1
and col1 < t.col1
and rownum <= 3) < 3
select col1,text1
from (select col1,text1,row_number() over(partition by text1 order by col1) rn
from tb) a
where rn<=3
SELECT col1,text1
FROM (SELECT t.*, row_number() over(PARTITION BY text1 ORDER BY col1) rn FROM t)
WHERE rn <= 3