I have the following UNION‘d statement:
SELECT 8
UNION ALL
SELECT 7
UNION ALL
SELECT 10
…and a normal SELECT statement:
SELECT column1
FROM table1
Now my question is, how to merge the two and get the following result
SELECT column1, 10 -- 10 is the biggest element in the UNION statement
FROM table1
None are particularly pretty, for the sake of returning a cartesian product:
The ANSI-89 approach:
The ANSI-92 approach, using CROSS JOIN (not supported on all databases):