Pheasant\Query\Query::distinct PHP Method

distinct() public method

Whether to prefix the SELECT clause with DISTINCT
public distinct ( $value = true )
    public function distinct($value = true)
    {
        $this->_distinct = $value;
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: QueryTest.php プロジェクト: lox/pheasant
 public function testDistinctColumn()
 {
     $query = new Query();
     $query->distinct()->select('userid')->from('user');
     $this->assertEquals('SELECT DISTINCT userid FROM user', $query->toSql());
 }