Select r.party_id party_id, p.party_number dealer_num, p.party_name dealer_name, sub_party.party_name owner_name
from hz_relationships r , hz_parties p, hz_parties sub_party,
where r.subject_id = sub_party.party_id
and r.object_id = p.party_id
and ((r.end_date is null) or (r.end_date > sysdate)) and r.status = 'A'
1 comment:
Post a Comment