I was wondering if we can do a select from dual and place our results at any of the result row? My desired result will be:
CID EXT
------ ------
ALL ALL
-- --
DATAA DATAA
DATAB DATAB
DATAC DATAC
I was doing
SELECT 'ALL' AS "CID"
, 'ALL' AS "EXT"
FROM DUAL
UNION
SELECT *
FROM
(
SELECT DISTINCT COLUMN AS "CID"
, COLUMN AS "EXT"
FROM TABLEA
)
but my results were
CID EXT
------ ------
-- --
ALL ALL
DATAA DATAA
DATAB DATAB
DATAC DATAC
OK, I think I found out the answer. If I used Jeffrey’s answer, I will get
So, I just changed to
Then my results work.