jg_zz_vat_rep_status join with transactions table
I need to join the tables jg_zz_vat_rep_status or jg_zz_vat_rep_entities with AR transactions tables. the query is:
select CASE
when count(DEFAULT_SET_CODE) > 0
then 'NON VALIDATO'
else 'VALIDATO'
END STATO
from (select distinct fnbu.DEFAULT_SET_CODE
,fnbu.bu_id
,COUNT(rcta.customer_trx_id) AS fatt_sede
from FUN_NAMES_BUSINESS_UNITS_V fnbu
,RA_CUSTOMER_TRX_ALL rcta
,ra_cust_trx_line_gl_dist_all rctd
,FND_DOCUMENT_SEQUENCES fds
,jg_zz_vat_rep_status st
,jg_zz_vat_rep_entities ent
where fnbu.status = 'A'
and fnbu.default_set_code not like '%COMMON%'
0