下面的查询选择了所有记录,其date_col的值是在最后30天以内: mysql> SELECT something FROM table
           WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;