一些SQL语句,有些地方可能不是很完美,但是基本上能解决最近的一些问题。
Select T_RZXX.RZ_ID,T_RZXX.RZ_DZ,T_RZXX.RZ_NRMS,T_MPXX.MP_ID,T_MPXX.MP_LX from T_RZXX left join T_MPXX on T_RZXX.RZ_ID = T_MPXX.MP_ID where T_RZXX.RZ_DJSJ > #2008-6-15# and T_RZXX.RZ_DJSJ < #2008-6-17# and T_MPXX.MP_LX='标准门牌'
Select T_RZXX.RZ_GLID,T_RZXX.RZ_DZ,T_RZXX.RZ_NRMS,T_MPXX.MP_ID,T_MPXX.MP_LX from T_RZXX left join T_MPXX on T_RZXX.RZ_GLID = T_MPXX.MP_ID where T_RZXX.RZ_DJSJ > #2008-6-15# and T_RZXX.RZ_DJSJ < #2008-6-17# and T_MPXX.MP_LX in('自编门牌','虚拟门牌') and T_RZXX.RZ_LX='1'
Select T_RZXX.RZ_GLID,T_RZXX.RZ_DZ,T_RZXX.RZ_NRMS,T_MPXX.MP_ID,T_MPXX.MP_LX from T_RZXX left join T_MPXX on T_RZXX.RZ_GLID = T_MPXX.MP_ID where T_RZXX.RZ_DJSJ > #2008-6-19# and T_RZXX.RZ_DJSJ < #2008-6-21# and T_MPXX.MP_LX in('自编门牌','虚拟门牌') and T_RZXX.RZ_LX='1'
Select T_RZXX.RZ_GLID,T_RZXX.RZ_DZ,T_RZXX.RZ_NRMS,T_MPXX.MP_ID,T_MPXX.MP_LX from T_RZXX ,T_MPXX where T_RZXX.RZ_GLID = T_MPXX.MP_ID and T_RZXX.RZ_DJSJ > #2008-6-19# and T_RZXX.RZ_DJSJ < #2008-6-21# and T_MPXX.MP_LX in('自编门牌','虚拟门牌') and T_RZXX.RZ_LX='1'
SELECT T_ZP_RZ.RZ_ZPID, T_RZXX.RZ_ID from T_ZP_RZ left join T_RZXX on T_ZP_RZ.RZ_ID =T_RZXX.RZ_ID WHERE T_ZP_RZ.ZP_DJSJ=#2008-6-19 0:00:00# and T_RZXX.RZ_LX = '1' SELECT T_ZP_RZ.RZ_ZPID, T_ZP_RZ.RZ_ZP, T_RZXX.RZ_ID from T_ZP_RZ left join T_RZXX on T_ZP_RZ.RZ_ID =T_RZXX.RZ_ID WHERE T_ZP_RZ.ZP_DJSJ>#2008-6-16# and T_ZP_RZ.ZP_DJSJ<#2008-6-19# and T_RZXX.RZ_LX = '1'
SELECT T_ZP_RZ.RZ_ZPID, T_ZP_RZ.RZ_ZP, T_RZXX.RZ_ID from T_ZP_RZ left join T_RZXX on T_ZP_RZ.RZ_ID =T_RZXX.RZ_ID WHERE T_ZP_RZ.ZP_DJSJ>#2008-6-16# and T_ZP_RZ.ZP_DJSJ<#2008-6-19# and T_RZXX.RZ_LX = '1' and T_ZP_RZ.RZ_ID =T_RZXX.RZ_ID SELECT T_ZP_RZ.RZ_ZPID, T_ZP_RZ.RZ_ZP, T_RZXX.RZ_ID from T_ZP_RZ left join T_RZXX on T_ZP_RZ.RZ_ID =T_RZXX.RZ_ID WHERE T_ZP_RZ.ZP_DJSJ>#2008-6-16# and T_ZP_RZ.ZP_DJSJ<#2008-6-18# and T_RZXX.RZ_LX = '1'
SELECT T_ZP_RZ.RZ_ZPID, T_ZP_RZ.RZ_ZP, T_RZXX.RZ_ID from T_ZP_RZ,T_RZXX where T_ZP_RZ.RZ_ID =T_RZXX.RZ_ID and T_RZXX.RZ_LX = '1' and T_ZP_RZ.ZP_DJSJ>#2008-6-16# andT_ZP_RZ.ZP_DJSJ<#2008-6-18#
SELECT RZ_ZP,RZ_ZPID From T_ZP_RZ,T_RZXX,T_MPXX WHERE T_RZXX.RZ_ID=T_ZP_RZ.RZ_ZPID and T_RZXX.RZ_GLID = T_MPXX.MP_ID and T_RZXX.RZ_LX='1'and T_MPXX.MP_LX in('自编门牌','虚拟门牌') and T_ZP_RZ.ZP_DJSJ>#2008-6-16# and T_ZP_RZ.ZP_DJSJ<#2008-6-18#
SELECT T_ZP_RZ.RZ_ZP,T_ZP_RZ.RZ_ZPID, T_RZXX.RZ_ID From T_ZP_RZ,T_RZXX,T_MPXX WHERE T_RZXX.RZ_ID=T_ZP_RZ.RZ_ID and T_RZXX.RZ_GLID = T_MPXX.MP_ID and T_RZXX.RZ_LX='1'and T_MPXX.MP_LX in('自编门牌','虚拟门牌','标准门牌') and T_ZP_RZ.ZP_DJSJ>#2008-6-16# and T_ZP_RZ.ZP_DJSJ<#2008-6-18#