我有12gb的表数据。
我的table是这样的:
userid name score
1 abc 1
1 pqr 1
2 mno 1
2 pqr 1
.
.
.
750000 mno 1
我的问题是:
select a.userid as user1,b.userid as user2, sum(a.score*b.score) as score,count(distinct a.name) as distinct_name from table a join table b on(a.name=b.name) limit 10;
它运行了数小时,但没有返回结果。我怎样才能解决这个问题?
1条答案
按热度按时间nxowjjhe1#
试试这个,
把你的表名换成表名;