有用的sql积累

SELECT COUNT(DISTINCT column(s)) FROM table
// 先group by,然后select,然后order by
select xxx from xxx where xxx and xxxx group by homework_id order by num desc limit 1;
ON DUPLICATE KEY UPDATE
原文地址:https://www.cnblogs.com/cjjjj/p/13424812.html