In MySQL
:
SELECT *
FROM mytable
WHERE record_date >= NOW() - INTERVAL 1 DAY
In SQL Server
:
SELECT *
FROM mytable
WHERE record_date >= DATEADD(day, -1, GETDATE())
In Oracle
:
SELECT *
FROM mytable
WHERE record_date >= SYSDATE - 1
In PostgreSQL
:
SELECT *
FROM mytable
WHERE record_date >= NOW() - '1 day'::INTERVAL
In Redshift
:
SELECT *
FROM mytable
WHERE record_date >= GETDATE() - '1 day'::INTERVAL
In SQLite
:
SELECT *
FROM mytable
WHERE record_date >= datetime('now','-1 day')
In MS Access
:
SELECT *
FROM mytable
WHERE record_date >= (Now - 1)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…