Delete using a condition
SQL
Easy
3 views
Problem Description
Delete orders where status='CANCELLED' and the order_date is older than 90 days from today.
Output Format
DML statement(s)
Sample Test Case
Input:
Orders(order_date, status)
Constraints
Assume PostgreSQL-style interval
Official Solution
DELETE FROM Orders WHERE status='CANCELLED' AND order_date < (CURRENT_DATE - INTERVAL '90 days');
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!