Write SQL query to solve given problem: Among the trains running west, how many trains have no more than one car with an open roof?. Keep the solution inside sql tag ```sql [SQL-Query] ```
SELECT SUM(CASE WHEN T1.direction = 'west' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) FROM cars WHERE roof = 'none' GROUP BY train_id HAVING COUNT(id) = 1 ) AS T2 ON T1.id = T2.train_id 