Есть таблица 1 (table1 as t1)
id, column_1, column_2, column_3
Есть таблица 2 (table2 as t2)
id, colums..
Есть запрос
Код: Выделить всё
SELECT t2.* FROM table1 t1 LEFT JOIN table2 t2 ON array[t2.id] = deleteByValue(array[t1.colums_1, t1.colums_2, t1.colums_3], array[1,2])