SELECT COUNT(zastavka) AS count,
       COUNT(DISTINCT zastavka) 
                    AS distinct
  FROM linky 
       JOIN 
       zastavky 
       ON zastavka_id=id AND smer=1
 WHERE linka=4;
