Orable Turn two separate queries into a single row

pm-archtect
pm-archtect used Ask the Experts™
on
Hi

Is it possible to take the following two queries and turn them in to one single row as a result?

SELECT COUNT(UNIT) AS RECEIVEDTODAY
FROM UNIT_KILOMETRAGE_HISTORY_VIEW
WHERE LINE = 'TestOne' AND TRUNC(DATERECEIVED) = SYSDATE

This might yield a number such as 6

SELECT COUNT(UNIT) AS PAST5DAYS
FROM UNIT_KILOMETRAGE_HISTORY_VIEW
WHERE LINE = 'TestOne' AND TRUNC(DATERECEIVED) = SYSDATE - 4

This might yield a different number such as 15
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
select (SELECT COUNT(UNIT) AS RECEIVEDTODAY
FROM UNIT_KILOMETRAGE_HISTORY_VIEW
WHERE LINE = 'TestOne' AND TRUNC(DATERECEIVED) = SYSDATE) col1,
(SELECT COUNT(UNIT) AS PAST5DAYS
FROM UNIT_KILOMETRAGE_HISTORY_VIEW
WHERE LINE = 'TestOne' AND TRUNC(DATERECEIVED) = SYSDATE - 4
) col2 from dual;

Author

Commented:
Brilliant - does just what it says on the tin.  Very fast response, thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial