get distinct ids for each group value mysql : I have a result-set as following:

    client_id   status
    ------------------
    67          1
    67          0
    67          0
    67          0
    77          0

I need to get only those `client_id` whose `latest (top)` entry is `0`.

I tried following but get both `67 and 77`. `67` should be excluded.

    SELECT DISTINCT client_id FROM
    (
        SELECT client_id, status FROM client_history 
        WHERE (DATE(updated_on) BETWEEN '$from' AND '$to') 
        ORDER BY DATE(updated_on) DESC
    ) as ch
    WHERE status = 0
    GROUP BY client_id

How to set condition so that I can get only those records whose `status` is 0.
