I got the result while executing my query as:
state city user_count restaurant_count order_count
a b 0 0 5
a c 2 0 0
a d 0 0 0
and my query is :
SELECT `eat_state_locale`.`state`, `eat_city_locale`.`city`, `eat_city_locale`.`location`, `eat_city`.`city_id`, count(distinct eat_user.user_id) as user_count, count(distinct eat_delivery.restaurant_id) as restaurant_count, count(distinct eat_order.order_id) as order_count FROM (`eat_state`) JOIN `eat_state_locale` ON `eat_state_locale`.`state_id`=`eat_state`.`state_id` JOIN `eat_city` ON `eat_state`.`state_id`=`eat_city`.`state_id` JOIN `eat_city_locale` ON `eat_city_locale`.`city_id`=`eat_city`.`city_id` LEFT JOIN `eat_user` ON `eat_user`.`city_id`=`eat_city`.`city_id` LEFT JOIN `eat_delivery` ON `eat_delivery`.`delivery_city_id`=`eat_city`.`city_id` LEFT JOIN `eat_order` ON `eat_order`.`delivery_city_id`=`eat_city`.`city_id` LEFT JOIN `eat_printer` ON `eat_printer`.`order_id`=`eat_order`.`order_id` WHERE `eat_state_locale`.`language_id` = 1 AND `eat_city_locale`.`language_id` = 1 GROUP BY `eat_city`.`city_id` ORDER BY `eat_state`.`state_id` asc
here i need to get the result like (after avoiding the null values as:)
state city user_count restaurant_count order_count
a b 0 0 5
a c 2 0 0
how will I get such result?Here no issue in the counted result..I need to avoid the null result
Edit: