
DataBase/PostgreSQL 2022. 8. 1.
[PostgreSQL] USING
using은 join의 양쪽이 조인 열에 대해 동일한 이름을 사용하는 특정 상황에서 활용할 수 있는 양식이다. 예를 들어, T1과 T2를 USING(a, b)으로 조인하면 조인 조건은 on T1.a = T2.a and T1.b = T2.b가 된다. 예제 1 select * from unnest(array[1,2,3,4,5]) as t1(id) inner join unnest(array[1,3,5]) as t2(id) using(id) -- 동일한 쿼리문 select * from unnest(array[1,2,3,4,5]) as t1(id) inner join unnest(array[1,3,5]) as t2(id) on t1.id = t2.id 예제 2 select * from unnest(array[1,..
