0
的独特组合,我们已经有一个网站的所有推荐的表格:(每推荐一个条目)谷歌大查询分拣多列
String : referral
String : target
integer: date
现在,我们想用大查询到所有推荐排序基于计数,如:
referral : target, count:
google.com/... : welcome.html, 28353
bing.com/... : welcome.html, 5334
gmail.com/... : about.html, 343
...
大查询SQL应该是什么?
我必须删除“不同”,所以它输出计数正确。 “SELECT count(path),path FROM(select concat(referrer,target)as path FROM [mydataset.referrallog])by path” –
但是这个sql没有根据count数对结果进行排序。 –
所以最终的答案是“SELECT count(path)as path_count,path FROM(select concat(referrer,target)as path FROM [mydataset.referrallog])group by path order by path_count desc”。 –