我想在去年展示所有每周数据。像周一到周五的所有数据。但我不明白如何编写查询。请帮我解决问题。
我会尝试这个查询...但是缺少一些日期数据。
SELECT * FROM `tablename`
WHERE WEEKDAY(`EffectiveStartDate`) BETWEEN 0 AND 4
AND WEEKDAY(`EffectiveEndDate`) BETWEEN 0 AND 4;
答案 0 :(得分:0)
尝试:
SELECT *
FROM table_name
WHERE Date(date_column) BETWEEN '2016-01-01' AND '2016-12-31'
AND Weekday(date_column) IN ( 0, 1, 2, 3, 4 );