📜  使用连接和计数获取数据的 sql 查询 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:08.309000             🧑  作者: Mango

代码示例1
Correlated subquery

SELECT job_Desc
 ,(select count(*) from employee where employee.job_id = jobs.job_id) as count
FROM Jobs
ORDER BY 2

refrence:
https://azagappan.wordpress.com/2006/06/23/using-count-with-joins/#:~:text=COUNT(*)%20returns%20the%20number,number%20of%20unique%2C%20nonnull%20values.