I'm dealing with the following union between two different tables in an Oracle Database.
the first query refers to vessels that are part of the current fleet of the payer_no. The second query refers to all vessels transacted with at some time.
If an item appears only in the first query, I want a custom column that says "current fleet" and if an item only appears in the second query, I want a column that says "past fleet."
Output would look like this:
UNION? (On a separate note - especially if you expect theUNIONto be disjoint anyway, and the members have no duplicate rows or you don't care if they have duplicate rows - useUNION ALLinstead ofUNIONfor better performance).