I want to concatenate _BAR to the results of a Query.
One of my first attempts is this:
SELECT lhs.f||rhs.f as concat_bar FROM (
SELECT 'FOO' as f FROM DUAL) lhs
LEFT JOIN
(
SELECT '_BAR' as f FROM DUAL) rhs
ON ('' != rhs.f)
;
but I got no results. I was expecting ON ('' != rhs.f)
to evaluate to true
so I expected as a result a single row: 'FOO_BAR'
. Which is the result of concatenating the cartesian product of the lhs and rhs tables.
How can I JOIN on TRUE
?
I know that, for the specific problem, other solutions as
SELECT lhs.f||'_BAR' FROM (
SELECT 'FOO' as f FROM DUAL) lhs;
are possible.
My question is on an effective syntax to make a cartesian product of two tables as a LEFT JOIN ON TRUE
.