带有 UNIX 时间戳字段的 MySQL 查询

问题描述:

我需要为 MySQL 编写一个查询,它检索 unix 时间戳字段("added_on")超过 6 个月的所有行.

I need to MySQL write a query where it retrieves all rows where the unix timestamp field ("added_on") is more than 6 months old.

SELECT *
FROM yourtable
WHERE added_on <= UNIX_TIMESTAMP(DATE_SUB(now(), INTERVAL 6 MONTH))