DISTINCT 方法用於返回唯一不同的值
官方文檔給出的示例:
$Model->distinct(true)->field('userName')->select(); 解析的SQL:SELECT DISTINCT `userName` FROM `table`
去重統計:
$totalRows = $this->where($where)->count('DISTINCT mobilePhone') 解析的SQL:SELECT COUNT(DISTINCT mobilePhone) AS tp_count FROM `table` WHERE `check` = 1
原文作者:rinald
原文地址:http://fity.cn/post/512.html
請您在轉載時保留此出處信息,尊重別人也是尊重自己。