select * from temp1 left join temp2 on temp1.id = temp2.id(select * from temp1 有355条记录)temp1表和temp2表只有Id一个字段关联,我要获取temp2表中type_name这个字段,表2中有重复的数据,所以我用left join 联合查询的话,返回的不止355条记录,我要怎样去掉重复的数据,sql语句太长,子查询太多,用distinct性能太低,有没有其他办法?
分组下应该就可以了的