【发布时间】:2013-08-14 10:56:06
【问题描述】:
我将编写 MySQL 查询,如学说中的跟随查询。
UPDATE vehicle a
INNER JOIN vehicle b ON a.id = b.id
SET a.total_view = b.total_view+1
WHERE a.id=1;
我尝试过遵循以下原则。但它不起作用。 有什么解决办法吗?
$q = Doctrine_Query::create()
->update('Vehicle v')
->innerJoin('v.Vehicle v2')
->set('v.total_view = v2.total_view+1')
->where('v.id = ?',$id);
return $q->execute();
【问题讨论】: