SELECT n.name_id, n.f_name, n.l_name, addr.city, addr.st, addr.zip
FROM name n JOIN TABLE(ADDRESS_SPLIT(n.addr_text)) addr(addr1, addr2, addr3, city, st, zip, county, country)
ON 1 = 1;
You can see examples in "DB2 for Linux, UNIX, and Windows SQL Reference Volume 1"
Chapter 5. Queries ---> Subselect ---> table-reference ---> Correlated references in table-references
Code:
So the following examples are valid syntax:
Example 1: SELECT t.c1, z.c5
FROM t, TABLE( tf3(t.c2) ) AS z -- t precedes tf3
WHERE t.c3 = z.c4; -- in FROM, so t.c2
-- is known
Code:
But the following examples are not valid:
Example 4: SELECT t.c1, z.c5
FROM TABLE( tf6(t.c2) ) AS z, t -- cannot resolve t in t.c2!
WHERE t.c3 = z.c4; -- compare to Example 1 above.