
use dy2025

/*
select * from taxfee
select * from taxdist
select concat('select top 3 bill_no from bill where propertykey in (select propertykey from property where realkey in (select realkey from taxfee_items where comp_no=''',comp_no,''')) union') from (select comp_no from taxfee ) q
select concat('select top 3 bill_no from bill where propertykey in (select propertykey from property where homeexempt=''',HOMEEXEMPT,''') union') from (select distinct homeexempt from property where proptype='R' and HOMEEXEMPT<>'S0') q
*/

select top 3 bill_no from bill where propertykey in (select propertykey from property where realkey in (select realkey from taxfee_items where comp_no='DL  ')) union
select top 3 bill_no from bill where propertykey in (select propertykey from property where realkey in (select realkey from taxfee_items where comp_no='SL  ')) union
select top 3 bill_no from bill where propertykey in (select propertykey from property where realkey in (select realkey from taxfee_items where comp_no='EDL ')) union
select top 3 bill_no from bill where propertykey in (select propertykey from property where realkey in (select realkey from taxfee_items where comp_no='FF01')) union
select top 3 bill_no from bill where propertykey in (select propertykey from property where realkey in (select realkey from taxfee_items where comp_no='FF02')) union

select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='01' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='02' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='03' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='04' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='05' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='08' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='12' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='14' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='18' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='19' ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where taxdistric='20' ) union 

select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where appeal=1 ) union 

select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='01' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='02' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='03' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='04' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='05' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='08' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='12' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='14' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='18' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='19' ) union 
select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where taxdistric='20' ) union 

select top 3 bill_no from bill where bill_type='P' and propertykey in (select propertykey from property where appeal=1 ) union 
select top 3 bill_no from bill where bill_type='R' and propertykey in (select propertykey from property where appeal=1 ) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='01' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='02' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='03' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='04' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='05' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='08' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='12' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='14' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='18' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='19' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='S1')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SC')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='S3')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='S4')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='S5')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SD')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SE')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SG')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SS')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SA')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SJ')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SV')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and realkey in (select realkey from CALCEXEMPTIONS where excode='SH')) union 
select top 3 bill_no from bill where propertykey in (select propertykey from property where taxdistric='20' and perskey in (select perskey from CALCEXEMPTIONS where excode='SF')) union 

select 0