MySql Count cannot show 0 values

后端 未结 1 1506
無奈伤痛
無奈伤痛 2020-11-27 08:59

I have two tables one Employee and mailing Subscriptions Employee looks like this:

Name (pk) | Surname | Age

mailing Subsriptions

MailId (pk)| Emplo

相关标签:
1条回答
  • 2020-11-27 09:10
    SELECT c.name, count(m.mailid)
    FROM Employee 
       LEFT JOIN mailingSubscriptions as m ON c.Name = m.EmployeeName
    GROUP BY c.name;
    
    0 讨论(0)
提交回复
热议问题