Displaying rows with count 0 with mysql group by

后端 未结 3 1773
甜味超标
甜味超标 2020-12-09 11:00

I have two tables in MySql Company : (cname,city) works : (ename,cname,salary)

I want to display number of employees working for every company, even if that number i

3条回答
  •  醉梦人生
    2020-12-09 11:59

    There is another way to do so with subquery, here is a sample from my case:

    select count(`order_id`) as cnt
    from (
        select `order_id` from `room_bookings`
        where `room_id` = 3 and `day_id` = 20180201 
        group by `order_id`
    ) as b;
    

提交回复
热议问题