Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

How to display the number of days elapsed between two dates denoted in columns-specifically those exceeding 30 days?

$
0
0

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?


Viewing all articles
Browse latest Browse all 717

Trending Articles