DROP VIEW IF EXISTS total_topics_assigned_view;
CREATE VIEW total_topics_assigned_view(
 project_id,
 offer_id,
 total_assigned
) as
SELECT 
    topics.project_id, 
    topics.offer_id,
    count(topics.id) as total_assigned
FROM topics 
where topics.status = 1
GROUP by topics.offer_id;