php mysql 统计数据重复的问题
Iduseridusernamefraction1555aaa62666bbb63555aaa124777ccc7select*,count(distinctname)f...
Id userid username fraction
1 555 aaa 6
2 666 bbb 6
3 555 aaa 12
4 777 ccc 7
select *, count(distinct name) from table group by name
最终结果
aaa 18 2
bbb 6 1
ccc 7 1
$sql = "select *, count(distinct name) from table group by name";
$query = $db->query($sql_log1);
while($log1 = $db->fetch_array($query))
{
$log_list1[] = $log1;
} 展开
1 555 aaa 6
2 666 bbb 6
3 555 aaa 12
4 777 ccc 7
select *, count(distinct name) from table group by name
最终结果
aaa 18 2
bbb 6 1
ccc 7 1
$sql = "select *, count(distinct name) from table group by name";
$query = $db->query($sql_log1);
while($log1 = $db->fetch_array($query))
{
$log_list1[] = $log1;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询