SELECT zj.tax
,zj.tax_jurisdiction_code
,hzg.geography_element2_code state_code
,hzg.geography_element3_code county_code
,hzg.geography_element4_code city_code
FROM zx_jurisdictions_b zj
,hz_geographies hzg
WHERE zj.tax_regime_codE='XX_SALE_TAX'
AND SYSDATE BETWEEN zj.effective_from AND NVL(zj.effective_to,'31-DEC-4999')
AND SYSDATE BETWEEN hzg.start_date AND hzg.end_date
AND zj.zone_geography_id=hzg.geography_id
AND zj.tax=hzg.geography_type
AND NOT EXISTS (SELECT 1
FROM zx_rates_b zr
WHERE zr.tax_regime_code='XX_SALE_TAX'
AND zr.tax_jurisdiction_code=zj.tax_jurisdiction_code
)
ORDER BY zj.tax
,zj.tax_jurisdiction_code
,hzg.geography_element2_code
,hzg.geography_element3_code
,hzg.geography_element4_code
No comments:
Post a Comment