TREATAS Applies the result of a table expression as filters to columns from an unrelated table.
TREATAS(table_expression, column[, column[, column[,…]]]} )
Table_expression – An expression that results in a table.
Column – One or more existing columns. It cannot be an expression.
A table that contains all the rows in column(s) that are also in table_expression.