/*
select PARCEL_NO, realkey from realprop where PARCEL_NO like 'sv030042%'

select * from WORTH_GSI.dbo.PARCEL where legal_desc like 'personal%' and bill_year=2021 and ACCT_NO='007900'
select * from personal where perskey=336

select st_num, st_name, st_type, count(*) from personal group by st_num, st_name, st_type having count(*)>1
select propclass, perskey from personal where ST_NUM=0
*/

select mobilekey, prebmapid, count(*)
from (
select m.mobilekey, g.mfg, g.MODEL, g.YR_BUILT, g.WIDTH, g.LENGTH, g.LINE_NO
	, m.PREBMAPID--, m.MFG, m.MODEL, m.WIDTH, m.LENGTH, m.YEARBUILT, m.MOBILEKEY
from WORTH_GSI.dbo.MOBIL g
inner join mobile m on m.PREBMAPID=g.MAP+g.PARCEL and g.TAX_YEAR=2014 and m.SERIALNUM=g.ID_NO1 and m.WIDTH=g.WIDTH and m.MFG=g.mfg and m.LENGTH=g.LENGTH and m.MODEL=g.MODEL and m.YEARBUILT=g.YR_BUILT
--order by m.MOBILEKEY
) x 
group by mobilekey, PREBMAPID 
having count(*)>1

/*
select * from WORTH_GSI.dbo.MOBIL where map='01030' and PARCEL='019' and TAX_YEAR=2016
select * from MOBILE where mobilekey=939
select * from worth_gsi.dbo.parcel where acct_no=197850
select * from worth_gsi.dbo.cash

select * from worth_gsi.dbo.parcel where left(st_code1,1)<>'E' and bill_year=2021 and convert(int,bill_no) not in (select convert(int,bill_no) from worth_gsi.dbo.cash union select convert(int,bill_no) from worth_gsi.dbo.[check])

select * from worth_gsi.dbo.cash where bill_year=2020 and bill_no='0000000005' and rectype='02' order by trans_date
select * from worth_gsi.dbo.parcel where bill_year=2020 and bill_no='0000000005' 
select * from [check] where tax_year=2020 and bill_no='0000000005'
select * from [cASH] where BILL_year=2020 and bill_no='0000000005' and rectype='05' and appcode='01'
*/