안녕하세요 다름이 아니라
select a.idx , a.korname , a.starttime
, a.endtime , a.starttime2 , a.endtime2
, b.idx , c.lecturetime , c.minute
, d.lecturetime as result
from olk_teachers a
inner join olk_teachistory b
on a.idx = b.teacheridx
and a.starttime <= '0610'
and a.endtime >= '0610'
and a.delflag = 'N'
and b.delflag = 'N'
and b.startdate <= convert(char(8), getdate(), 112)
and b.moddate >= convert(char(8), getdate(), 112)
inner join olk_sukang c
on b.sukangidx = c.idx
and c.teacheryn = 'Y'
left outer join olk_sukang d
on d.lecturetime = '0610' <-- 요 부분이 문제 인데요
and c.idx = d.idx
order by a.idx , c.lecturetime asc
위 쿼리로 얻는 정보는
![](http://www.shalle.com/test_auction/result.jpg)
이 정보와 같은데
result 에 보시면 0610이라고 뜨는것이 보이는데요..
0610 이 뜨는 강사를 포함 중복해서 강사들이 시간 타임이 쭉 뜨는데..
그 강사 시간에 0610이 한부분을 차지하는건데
그 0610이라고 차지한 강사를 리스트에서 제거하고
result에 0610이라고 뜨지 않고 오로직 전체가 null인 강사만 뜨게
쿼리를 수정하고 싶은데 어떻게 하면 좋을까요?? |