--- 2019.01.01 - 2019.12.31期间未使用的会员卡 select * from hyda where objid not in (select hybh from posmxxs_201901 union select hybh from posmxxs_201902 union select hybh from posmxxs_201903 union select hybh from posmxxs_201904 union select hybh from posmxxs_201905 union select hybh from posmxxs_201906 union select hybh from posmxxs_201907 union select hybh from posmxxs_201908 union select hybh from posmxxs_201909 union select hybh from posmxxs_201910 union select hybh from posmxxs_201911 union select hybh from posmxxs_201912 ) --- 2019.01.01 - 2019.12.31期间 使用的会员卡 select * from hyda where objid in (select hybh from posmxxs_201901 union select hybh from posmxxs_201902 union select hybh from posmxxs_201903 union select hybh from posmxxs_201904 union select hybh from posmxxs_201905 union select hybh from posmxxs_201906 union select hybh from posmxxs_201907 union select hybh from posmxxs_201908 union select hybh from posmxxs_201909 union select hybh from posmxxs_201910 union select hybh from posmxxs_201911 union select hybh from posmxxs_201912 )