select distinct bigclass from type where bid in (select bid from type where third<>'' order by bid,sid,tid)这样试试,选择某个id然后在用where语句关联~~~