标签: mysql select date
我想在1周前数据之间选择数据,直到今天的数据:
SELECT username, email, date FROM users WHERE date(date) BETWEEN (CURDATE() AND (CURDATE() - 7)) ORDER BY userid DESC LIMIT 10
希望你们能帮助我。它不起作用!!!
lexu
(有人可以关闭这个问题吗?)
答案 0 :(得分:2)
SELECT username , email , date FROM users WHERE date(date) BETWEEN DATE_SUB(CURDATE(), interval 1 week) AND CURDATE() ORDER BY userid DESC