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.
カウントの個別選択を行うにはどうすればよいですか?基本的に私はこれらすべての料金を持っており、その料金に関与している個別の従業員の数だけを数えたいと思います。(私はすでにgroup byの他のフィールドを持っています)
SELECT COUNT(DISTINCT employeeid) FROM ....
単純なもの:select count(distinct(field)) from table
select count(distinct(field)) from table
ライブサンプル:http ://sqlfiddle.com/#!3/81379/2/3
(TSQLで)DISTINCTにを入れることができます:COUNT
DISTINCT
COUNT
SELECT COUNT(DISTINCT(employee)) ...