列に値を含む SQL 列があり、ランク付けされた形式で最も多く発生する値を知りたいです。たとえば、List というテーブルにデータがあり、列に次のような値があるとします。
COLUMN
one
five
five
five
three
two
eight
nine
two
one
two
two
SQL は、2、5、1 の上位 3 つの値を返す必要があります。これをSQLでどのように行うことができますか。私はMYSQLを使用していることに注意してください。
また、各列の値にタイム スタンプが設定されている場合、週の開始日と終了日を手動で入力しなくても、その週に最も多く発生した値を見つけることができますか?