-1

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.

ありがとうございました。

4

3 に答える 3

0

このRank機能は、おそらくあなたが探しているものです。

http://msdn.microsoft.com/en-us/library/ms176102.aspx

于 2012-07-26T15:05:57.147 に答える