SELECT * FROM mytable WHERE date < DATE_SUB(NOW(), INTERVAL 30 DAY);
我如何在Doctrine 1.2中做到这一点?
答案 0 :(得分:4)
你试过这个答案吗? how to make Doctrine_Expression ( doctrine 1.2 ) try to get last 7 days
$date = new Doctrine_Expression('DATE_SUB(NOW() , INTERVAL 30 DAY)');
$q->where('date > ' . $date);