<p> <a target="_blank" href="https://kin.naver.com/qna/detail.nhn?d1id=1&dirId=10205&docId=381564312" target="_blank">외부 쿼리에서 서브쿼리로 값을 보내주고싶어요. : 지식iN (naver.com)</a> </p> <p> </p> <p> <img src="http://thimg.todayhumor.co.kr/upfile/202102/1612962086e08f8935e12e4f489956874486fc0e52__mn104419__w800__h599__f100767__Ym202102.png" alt="temp.png" style="width:800px;height:599px;" filesize="100767"></p> <p> </p> <p> <img src="http://thimg.todayhumor.co.kr/upfile/202102/1612962086ff457941d7d54275b0c74ae93c8e6f28__mn104419__w800__h151__f16071__Ym202102.png" alt="temp2.png" style="width:800px;height:151px;" filesize="16071"></p> <p> </p> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">해당 모델링에서 다음과같은 UI 에 데이터로 뽑아내고 싶습니다.</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">subjects 테이블로부터</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <div style="margin:0px;padding:0px;">SELECT subject_no, subj_group, subj_name, subj_score, subj_name, subj_professor, lect_date, lect_start, lect_end</div> <div style="margin:0px;padding:0px;">FROM subjects s</div> <div style="margin:0px;padding:0px;">WHERE subj_semester='1'</div> </div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">다음과같은 쿼리문으로 1학기에 수강가능한 과목들을 모두 뽑아낼 수 있습니다.</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">하지만 강의평가점수 부분이 문제인데요,</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">registers 테이블에서 강의방법, 계획성일치, 목표부합도, 이해수준고려도, 시험평가도</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">총 다섯가지항목의 평균갑을 보여주고 싶습니다..</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">sql문으로 뽑아내자면</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <div style="margin:0px;padding:0px;">SELECT ( SUM(eval_how)/COUNT(*) + SUM(eval_planning)/COUNT(*) + SUM(eval_goal)/COUNT(*) + SUM(eval_consider)/COUNT(*) + SUM(eval_test)/COUNT(*) ) / 5 as lectureScore</div> <div style="margin:0px;padding:0px;">FROM registers r, subjects s</div> <div style="margin:0px;padding:0px;">WHERE r.subject_no = '00110' AND subj_professor='다람쥐'</div> <div style="margin:0px;padding:0px;">AND reg_year=2020 AND reg_semester='1'</div> </div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">다음과같이 현재 2021년 1학기 기준으로 전년도 1학기의 00110번과목과 다람쥐교수의 모든 강의평가 정보를 합산하여 평균을 낸 값을 처음에 보여드린 컬럼에 포함시켜서 보여주고 싶습니다.</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">하지만 !!!</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <div style="margin:0px;padding:0px;">SELECT subject_no, subj_group, subj_name, subj_score, subj_name, subj_professor, lect_date, lect_start, lect_end, (</div> </div> <blockquote style="font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;margin:0px 0px 0px 40px;border:none;padding:0px;"> <div style="margin:0px;padding:0px;"> <div style="margin:0px;padding:0px;"> <div style="margin:0px;padding:0px;">SELECT ( SUM(eval_how)/COUNT(*) + SUM(eval_planning)/COUNT(*) + SUM(eval_goal)/COUNT(*) + SUM(eval_consider)/COUNT(*) + SUM(eval_test)/COUNT(*) ) / 5</div> <div style="margin:0px;padding:0px;">FROM registers r, subjects s</div> <div style="margin:0px;padding:0px;">WHERE r.subject_no = 'subj_name' AND subj_professor='subj_professor'</div> <div style="margin:0px;padding:0px;">AND reg_year=2020 AND reg_semester='1') as lectureScore</div> </div> </div> </blockquote> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <div style="margin:0px;padding:0px;">FROM subjects s</div> <div style="margin:0px;padding:0px;">WHERE subj_semester='1'</div> </div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">이런식으로 서브쿼리 내에 외부쿼리의 컬럼값을 전해주고싶지만 그게 되질 않습니다...</div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;"> <br></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;font-size:16px;background-color:#ffffff;">어떻게 해결해야 할까요?? </div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.