| index

View V_PARTY_ADDRESSES

Columns

Name | Type | Optional | Default | Comments
ID | NUMBER |  |  |
ADDRESS_CODE | VARCHAR2(80) |  |  |
SUB_BUILDING | VARCHAR2(40) | Y |  |
BUILDING | VARCHAR2(40) |  |  |
STREET | VARCHAR2(60) |  |  |
CITY | VARCHAR2(40) |  |  |
POSTCODE | VARCHAR2(8) |  |  |
START_DATE | DATE |  |  |
END_DATE | DATE | Y |  |
COMMENTS | VARCHAR2(255) | Y |  |
RT_CODE | VARCHAR2(80) |  |  |

SQL

    CREATE OR REPLACE VIEW V_PARTY_ADDRESSES AS
    SELECT parties.id,
           addresses.code AS address_code,
           addresses.sub_building,
           addresses.building,
           addresses.street,
           addresses.city,
           addresses.postcode,
           party_addresses.start_date,
           party_addresses.end_date,
           party_addresses.comments,
           party_address_roles.rt_code
      FROM addresses,
           party_addresses,
           party_address_roles,
           parties
     WHERE addresses.code = party_addresses.addr_code
           AND party_addresses.start_date = party_address_roles.paddr_start_date
           AND party_addresses.addr_code = party_address_roles.paddr_addr_code
           AND party_addresses.prty_id = party_address_roles.paddr_prty_id
           AND parties.id = party_addresses.prty_id;