Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SQL の列で最も高い繰り返しフィールドを表示する方法は?
たとえば、列に次が含まれている場合:
ジャック ジャック ジョン ジョン ジョン
上記の列から最大の繰り返しフィールド (ie) john を表示するにはどうすればよいですか?
select chairman from mytable group by chairman HAVING COUNT(*) = ( select TOP 1 COUNT(*) from mytable group by chairman ORDER BY COUNT(*) DESC)