mysql常用总结
mysql 分组取时间最大的一条
1、SELECT * FROM (SELECT * FROM posts ORDER BY dateline DESC) BIAOMING GROUP BY tid ORDER BY dateline DESC LIMIT 10
2、SELECT t.rech_gagaid,t.create_date FROM `t_recharge` t WHERE t.rech_state=1 AND t.rech_type <> 'CardPay' AND t.create_date = (SELECT MAX(create_date) FROM t_recharge WHERE rech_gagaid = t.rech_gagaid) ORDER BY t.create_date DESC