i have two tables (main\_table) and (sub\_table) related by person\_id ..now i want to select person\_id from main table and count of records in sub\_table that related to main\_table where records in sub\_table not equal 'eco' .. now the problem is when i make this .. the query get only person\_id that not equal 'eco' ... but i want from query to select every person\_id and select count 0 if person\_id in sub\_table equal 'eco' : 

```
    SELECT m.person_id, COUNT(*) AS eco FROM  (SELECT person_id FROM Main_table
                    WHERE     (person_id ='c')AS m INNER JOIN
                      (SELECT  person_id
                         FROM         sub_table
                         WHERE person_status != 'eco' 
                         GROUP BY person_id) AS eco ON eco.person_id = m.person_id GROUP BY m.person_id

```