by prettyscripts on 2010-06-16 16:28:27
to select distinct column values from a table, there are a few things to note to make sure only distinct rows are returned.
in /path/to/lib/model/doctrine/SomeTable.class.php:
PHP:
public function getDistinctValue() { | |
$q = Doctrine_Query()::create() | |
->select('DISTINCT column_name as some_column') | |
->from('SomeTable'); | |
return $q->fetchArray(); | |
} |
notes: