non riesco a fare una query..

allora
ho 3 tabelle:

cat:
id 1 2 3 4 5 6
nome

usa_cat
id_cat
id_tab

tab
id
stato='ok','np'

devo fare una query che mi selezioni tutte le cat e mi conti quante tab ci sono collegate per ognuna di esse.le tab contate devono avere lo stato ok

ecco come sto facendo ora:

SELECT cat.*, count(usa_cat.id)
from cat left join usa_cat on cat.id=usa_cat.id_cat left join tab on tab.id=usa_cat.id_tab
where tab.stato='ok'
group by categoria.id

la query è sbagliata perchè mi conta anche gli altri stati di tab oltre ad ok..cosa sbaglio?
grazie