Skip to content
RED SAG Skills
hardStudy question · answer published in PostgreSQL interview questions, so no pointsrenewalssql

A buggy upcoming-renewals query

This PostgreSQL query should list active contracts ending in the next 90 days, but it returns contracts that ended last year. What is the bug?

SELECT account_name, end_date, arr
FROM contracts
WHERE status = 'active'
  AND end_date <= CURRENT_DATE + INTERVAL '90 days'
ORDER BY end_date;
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions