You should use the CONNECTION TO component of the SELECT
statement’s FROM clause to submit native SQL requests that
produce a result set.
The CONNECTION TO component
has the following syntax:
FROM CONNECTION TO catalog (native-syntax) [[AS] alias]
Arguments
catalog |
specifies the name of a catalog in the existing FedSQL
connection.
|
native-syntax |
specifies a select-type query (not DDL) to be run on the
catalog's driver.
|
alias |
provides a name for the result set produced by the native
query.
|
select oo.i, oo.rank, ff.onoff
from connection to catalog_a
( select i, rank() over (order by j) rank from table_a ) oo,
connection to catalog_b
( select distinct i, iif(k > 0.5, 1, 0) as onoff from table_a ) ff
where oo.i = ff.i
order by 1;