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.
表works(emNo, comNo, salary)。
works(emNo, comNo, salary)
". Suppose it gives me a column with 5 rows. How do I count "これらの行ごとに「作品emNoから個別のcomNoを選択」を使用して個別のcomNoを取得できますか?
". Suppose it gives me a column with 5 rows. How do I count "
GROUP BYの種類ごとに集計するために使用できますcomNo。
GROUP BY
comNo
SELECT comNo, count(emNo) FROM works GROUP BY comNo
comNoこれにより、グループごとのレコード数とともに、の個別の値ごとに 1 つの行が返されます。
デモ: http://www.sqlfiddle.com/#!2/4f5df/1