일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- league of legends
- Aspose.cells
- 한번에 업데이트 인서트 하기
- 한글깨짐
- merge match
- upbit
- Banker's
- swift 화면전환
- python
- 일본여행
- chart.js
- 보유중스킨
- MS-SQL
- MYSQL
- update / insert
- Oracle
- rounding
- Android
- .csv
- 썸머노트
- MSSQL
- Banker's rounding
- 나만의 상점
- 초딩수학
- Kakao API Address
- 업비트
- LEFT JOIN
- Request.Form
- Excel
- CSV
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