尝试:
SELECt DATE_SUB(CURDATE(), INTERVAL i DAY) date_created_at, count(id) FROM (SELECT 1 i UNIOn ALL SELECT 2 UNIOn ALL SELECT 3 UNIOn ALL SELECT 4 UNIOn ALL SELECT 5 UNIOn ALL SELECT 6 UNIOn ALL SELECT 7) iLEFT JOIN user_accts ON date(created_at) = DATE_SUB(CURDATE(), INTERVAL i DAY) GROUP BY DATE_SUB(CURDATE(), INTERVAL i DAY)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)