我有logs
一个名为记录谁输入或输出数据的表。现在我不想得到谁贡献最多的统计数据并对其进行排名。
列是
Occur_Time | iUser_id | iUsername | oUser_id | oUsername
--iUser_id is the input persons index from another table that lists the username.
--iUsername is the input persons name.
--oUser_id is the index of the person who took the input away.
--oUsername is the name of the person who took the input away.
现在我想知道谁的投入最多。
我的逻辑:
Example:
User_id is 1, name is One.
Check how many times 1 is repeated on iUser_id = 100 times.
Check how many times 1 is repeated on oUser_id = 10 times.
User_id=1 has contributed 90 times.
Then sort by who has most contribution.
谢谢你。