Is it possible to extend query results with literals like this?
select name from users
union
select name from ('JASON');
or
select age, name from users
union
select age, name from (25,'Betty');
so it returns all the names in the table plus 'JASON', or (25,'Betty').
You use it like this:
Use
UNION ALL
to allow duplicates: if there is a 25-years old Betty among your users, the second query will not select her again with mereUNION
.In SQL Server, you would say:
In Oracle, you would say
Yes.
UNION
to add Jason if it isn't already in the result set.UNION ALL
to add Jason whether or not he's already in the result set.