查询 PostgreSQL 数据库中的今天、昨天和一个月内的数据

小明 2025-04-28 12:54:02 8

要���询 PostgreSQL 数据库中的今天、昨天和一个月内的数据,你可以使用以下 SQL 查询语句作为参考:

()
  1. 查询今天的数据:
SELECT * FROM your_table
WHERE your_date_column >= current_date
AND your_date_column  
  1. 查询昨天的数据:
SELECT * FROM your_table
WHERE your_date_column >= current_date - 1
AND your_date_column  
  1. 查询一个月内的数据:
SELECT * FROM your_table
WHERE your_date_column >= current_date - interval '1 month'
AND your_date_column 
The End
微信