在报表中使用SQL的current_date函数可以方便地获取当前日期,常用于生成当天的报表数据或筛选出特定日期范围内的数据。以下是在报表中应用SQL current_date函数的一些技巧:
SELECT * FROM table_name WHERE DATE(date_column) = current_date
SELECT * FROM table_name WHERE date_column >= current_date - INTERVAL '1 week' AND date_column <= current_date
SELECT SUM(sales_amount) FROM table_name WHERE DATE(date_column) = current_date
SELECT 'Daily Sales Report - ' || current_date AS report_title
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>