Realization of ideas:inner join on + max() + group by
- The latest time is calculated by summing each set of the function max () and group by;
- Combining the original table generated by the step 1 inner join, the time selected by the latest piece of data on the conditions.
Implement SQL:
SELECT * FROM personData as table1 INNER JOIN (SELECT table2.named,max(table2.date) as max FROM personData as table2 WHERE county="历下区" GROUP BY table2.named) as table3 ON table1.named = table3.name AND table1.date=table3.max
Ideas bug: order by + group by
;