다양한 SQL 스타일을 활용하여 계층형(hierarchy) 쿼리를 표현하는 방법
2021. 10. 31. 21:48
Programming/SQL
Difference between bigquery sql and other sql to write hierarchy sql I. 계층형 데이터(Hierarchical data) WITH employee AS ( SELECT 40 AS id , 'london' AS name, 50 AS boss_id UNION ALL SELECT 50 AS id , 'lee' AS name, 10 AS boss_id UNION ALL SELECT 10 AS id , 'harry' AS name, 20 AS boss_id UNION ALL SELECT 20 AS id , 'leo' AS name, NULL AS boss_id UNION ALL SELECT 70 AS id , 'lucas' AS name, 10 AS boss..