如何使用propel转换此SQL查询?

时间:2010-07-08 08:56:55

标签: symfony1 propel

我不知道如何翻译此查询:

SELECT distinct(id_ville) FROM `point_location`

我尝试这样做,但它不起作用:

$c = new Criteria();
$c->add(PointLocationPeer::ID_VILLE, Criteria::DISTINCT);
$c->setDistinct();
$this->villes = PointLocationPeer::doSelect($c);

1 个答案:

答案 0 :(得分:0)

尝试这样的事情:

$c = new Criteria();
$c->addSelectColumn(PointLocationPeer::ID_VILLE);
$c->setDistinct();
$this->villes = PointLocationPeer::doSelect($c);