by 공기 [SQL Query] [2025.03.25 18:54:05]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | select count (*) from table_a a join table_b b on col_a = col_b left join table_c c on col_b = col_c where a.col_x = b.col_x and a.col_y = b.col_y ; 이렇게 count (*)를 했는데.. 위 left out join 된 table_c 는 건수에 영향을 안주니까, select count (*) from table_a a join table_b b on col_a = col_b where a.col_x = b.col_x and a.col_y = b.col_y ; |
위아래 쿼리가 똑같은 쿼리가 되는거 아닌가요?
(outer join된 table_c를 삭제)
sm운영팀에서 사용하는 쿼리인데..
틀린것같은 쿼리를 너무 당연하게 사용하고있어서...ㅡ.ㅡ;;;