CREATE TEMPORARY TABLE IF NOT EXISTS table1( pid string, feature int)CREATE TEMPORARY TABLE IF NOT EXISTS table2( pid string, lable int)INSERT INTO TABLE table1(pid, feature) VALUES('a', 1) Select * from (select pid, max(feature) from table1 group by pid) as a left join table2 as b on a.pid = b.pid Select * from (select pid, max(feature) from table1 group by pid) as a join table2 as b on a.pid =..