本文介绍了如何从选择的法规中选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
select dw.C_DSC_Code,MAX(dr.d_date_report) from TBL_DWR_DETAILS dw
left join tbl_dwr dr on dr.N_Srno=dw.N_Srno
where dw.C_DSC_Code in ( 'D34848',
'D34796','D34799','D34801',
'D34712','D34772','D34784','D34785',
'D34787','D34816','D34765','D34779',
'D34770','D34755','D34782','D34822',
'D34687','D34817','D34759','D34777',
'D34750','D34778','D044633','D34746',
'D34749','D34819','D34747','D34769',
'D34781','D34748','D34824','D34834',
'D34776','D34670','D34763','D34757',
'D34827','D34756','D34760','D34690',
'D34739','D34716','D34768','D34825',
'D34766','D34741','D34713')
group by
dw.C_DSC_Code
在这个qvery我希望看到括号内的所有47位医生..但它只从tbl_dwr_details表中获取匹配值,即只有44条记录,但我需要不匹配的记录3doctors ..如何让thar请帮助我
In this qvery i want to see all 47 doctors inside the bracket..but it fetches only matching values from tbl_dwr_details table i.e only 44 records but i need unmatching record of 3doctors..how to make thar pls help me out
推荐答案
select dw.C_DSC_Code,MAX(dr.d_date_report)
from tbl_dwr dr
left join TBL_DWR_DETAILS dw on dr.N_Srno=dw.N_Srno
AND dw.C_DSC_Code in ( 'D34848',
'D34796','D34799','D34801',
'D34712','D34772','D34784','D34785',
'D34787','D34816','D34765','D34779',
'D34770','D34755','D34782','D34822',
'D34687','D34817','D34759','D34777',
'D34750','D34778','D044633','D34746',
'D34749','D34819','D34747','D34769',
'D34781','D34748','D34824','D34834',
'D34776','D34670','D34763','D34757',
'D34827','D34756','D34760','D34690',
'D34739','D34716','D34768','D34825',
'D34766','D34741','D34713')
group by
dw.C_DSC_Code
这篇关于如何从选择的法规中选择数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!