1.数据去重
//过滤id相同的数据$ Modela ->field('id,name’)->group('id’)->select();sql: select id,name from user group by name;
2.随机取几条数据
$Model->limit(3)->order('rand()’)->select();sql: select * from user order by rand();
3.获得数据字段名字相同的字段及数量
$Model->field('text,count(text) as text count’)->group('text’)->select(),sql:select text,count(text) as text count from 表 group by text,