일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 코딩입문
- 엔트리
- upbit
- 블록코딩
- .csv
- Excel
- chart.js
- python
- 오블완
- MS-SQL
- league of legends
- MYSQL
- swift 화면전환
- ASP.NET MVC
- PromptEngineering
- 스크래치코딩
- AIoptimization
- Aspose.cells
- 파이썬입문
- 썸머노트
- Kakao API Address
- MSSQL
- largelanguagemodels
- 나만의 상점
- 업비트
- 한글깨짐
- 일본여행
- httpclient timeout
- 초딩수학
- Android
Archives
- Today
- Total
DBA
left join 할때, on 절의 조건과 where절의 조건과의 차이 본문
728x90
반응형
SMALL
left join 할때, on 절의 조건과 where절의 조건과의 차이
회사에서 일하다가 헷갈려서...
---- 1. Left Join을 수행하고 null인 것을 날려 버림. (Row 수가 줄어듬.)
select * from T_AnswerRaw as ar
left join T_Question as q on q.questionNumber = ar.questionNumber and q.subQuestionNumber = ar.subQuestionNumber and q.questionVariable = ar.questionVariable
where ar.answers is not null
---- 2. not null인것에만 Left Join을 수행 함. (T_AnswerRaw의 전체 Row수를 기준으로 나옴.)
select * from T_AnswerRaw as ar
left join T_Question as q on q.questionNumber = ar.questionNumber and q.subQuestionNumber = ar.subQuestionNumber and q.questionVariable = ar.questionVariable
and ar.answers is not null
728x90
반응형
LIST
Comments