SQL 查询上个月数据:筛选 card_date 字段
SELECT * FROM table_name WHERE a.card_date > DATEADD(month, DATEDIFF(month, 0, GETDATE())-1, 0) AND a.card_date < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0)
原文地址: https://www.cveoy.top/t/topic/mQbr 著作权归作者所有。请勿转载和采集!