Below query I am trying to filter status id =7 records for team_id>1 But want to include records with status_id=7 for team_id=1.How can we write the query.
SELECT MAX(created_date) AS maxtime,
TEAM_ID,
ticket_id
FROM ri_ticket_status_history
WHERE status_id<>7
GROUP BY TEAM_ID,ticket_id