최근 포토로그


cross apply 셈플 0

select * 
  from oqm_qc_category A
 where start_dt in ( select MAX(x.start_dt)
                       from oqm_qc_category x
                      where A.qc_category_cd = x.qc_category_cd )
   --and qc_category_cd = 'M170604542'

SELECT TA.*
FROM oqm_qc_category TA
   CROSS APPLY (SELECT TOP 1 * FROM oqm_qc_category TB
                             WHERE TB.qc_category_cd = TA.qc_category_cd
                              AND TB.start_dt <= TA.start_dt
                              ORDER BY start_dt DESC) TT
--where    TA.qc_category_cd = 'M170604542'


덧글

댓글 입력 영역