You are given customer, ticket, and error-log data for an Aveva support workflow. Write a PostgreSQL query that joins the three tables to help troubleshoot a recurring issue by returning each customer’s open or recently closed tickets with the matching error details, including a flag that marks whether the error appears more than once for that customer.
Use the data to surface only tickets tied to the recurring error pattern and order the result so the most recent ticket appears first.