3
我有一个基本的查询获取结果早于当天所有的结果:过去六个月,我如何使用mysql获取结果?
...where post_date < '".current_time('mysql')."'....
如何,我只取结果,在过去6个月,即:
...where post_date > '".current_time('mysql')."' - 6 MONTHS && post_date < '".current_time('mysql')."'...
我将如何在我当前的查询中使用它? – InnateDev 2010-11-18 08:54:16
抱歉花了一些时间来弄清楚,我习惯于使用SQL Server :)这应该工作。 – thomaspaulb 2010-11-18 08:57:23
post_date> DATE_SUB(NOW(),INTERVAL 6 MONTH) – InnateDev 2010-11-18 09:21:59