SELECT * FROM tb_history th where not exists ( select 1 from tb_history where key_word = th.key_word and create_time > th.create_time ) ORDER BY create_time desc limit 10
MySQL中的select结果按时间排序
5 min read
SELECT * FROM tb_history th where not exists ( select 1 from tb_history where key_word = th.key_word and create_time > th.create_time ) ORDER BY create_time desc limit 10