Re: Adding to query result using UNION
Yes, I worked it out myself:
SELECT username, logondate, logontime
FROM prodndb.tblUsers
WHERE LogonDate <> ""
UNION
SELECT
' ' as username, ' ' aslogondate , ' ' as logontime
UNION ALL
SELECT
' ' as username, ' ' aslogondate , ' ' as logontime
UNION ALL
SELECT
' ' as username, ' ' aslogondate , ' ' as logontime
The use of "ALL" was the answer. It is needed because I'm adding duplicate keys.
Subject
Written By
Posted
Re: Adding to query result using UNION
June 05, 2021 07:54PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.