Perhaps I'm overthinking this Oracle SQL query, but I'm attempting to display the number of days elapsed between two column data-sets attributed as "order-date" and "ship-date", which will be displayed within a new alias column, "Number of Days elapsed"- so far, I've constructed the following query:
SELECT order_id,
(shipped_date - order_date) AS "Number of Days elapsed"
FROM orders;
Evidently, an alias column can't be sorted or filtered- so what options are available to filter the resulting output for the number of orders exceeding 30 days to ship?
WHERE (shipped_date - order_date) > 30 ORDER BY (shipped_date - order_date)
?