1. (5) select *
    2. (1) from table2 t1
    3. (2) left join table2 as t2 on t1.t2id=t2.id
    4. (3) where tj
    5. (4) group by t1.type having count(*)>type
    6. (6) order by type desc
    7. (7) limit 1,2