Monday, March 21, 2011

OCM - How to extract Dealer names and its related Owner names


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:

ursuleabby said...
This comment has been removed by a blog administrator.