2013-02-22 72 views

回答

0

有一個count()功能在phpAR,但你不能讓我不適用於DISTINCT。所以,我認爲最簡單的是:

$total = SomeModel::first(['select' => 'COUNT(DISTINCT `number`) AS `total`'])->total; 
相關問題