Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 PHP 中使用这个 SQL 语句:
$sql2="SELECT * from billing_pdf_archive2 where datetime = DATE(NOW() - INTERVAL 14 DAY) and sequence = '".$result["sequence"]."' ";
它工作正常,但它只是从日期时间字段中选择 14 天前。有什么办法可以让它选择 14 天前或更早?所以 15、16、17、18 天等等......但绝不会少于 14 天
超过 14 天前:
$sql2="SELECT * from billing_pdf_archive2 where datetime < DATE(NOW() - INTERVAL 14 DAY) and sequence = '".$result["sequence"]."' ";