CREATE OR REPLACE VIEW V_PRTY_ID_FOR_ENQUIRIES AS
SELECT DISTINCT enro.enqu_id
               ,enro.start_date
               ,enro.end_date
               ,enro.DESCRIPTION
               ,prel.from_parl_prty_id AS prty_id
               ,prel.from_rt_code AS rt_code
  FROM v_party_relationships prel
      ,enquiry_roles         enro
 WHERE prel.to_parl_prty_id = enro.prty_id
      --AND enro.rt_code = 'ENQ SUPP'
   --AND prel.from_rt_code IN ('SUPPADMIN', 'AGENT')

