GPBR_AU_CNPJ_VW

(SQL View)
Index Back

View for CNPJ

View for CNPJ from Establishment.

SELECT DISTINCT B.COMPANY ,A.ESTAB_ID_BRA ,b.estabid , B.DESCR FROM PS_ESTAB_ID_BRA A , PS_ESTAB_TBL B WHERE A.COUNTRY='BRA' AND A.ESTAB_ID_TYPE_BRA='CNPJ' AND B.ESTABID=A.ESTABID AND B.COUNTRY=A.COUNTRY AND A.EFFDT=( SELECT MAX(C.EFFDT) FROM PS_ESTAB_ID_BRA C WHERE C.ESTABID=A.ESTABID AND C.COUNTRY=A.COUNTRY AND C.ESTAB_ID_TYPE_BRA=A.ESTAB_ID_TYPE_BRA) AND B.EFFDT=( SELECT MAX(D.EFFDT) FROM PS_ESTAB_TBL D WHERE D.ESTABID=B.ESTABID) AND B.COMPANY=COMPANY

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 COMPANY Character(3) VARCHAR2(3) NOT NULL Company
2 ESTAB_ID_BRA Character(20) VARCHAR2(20) NOT NULL Establishment ID Brazil
3 ESTABID Character(12) VARCHAR2(12) NOT NULL Establishment ID
4 DESCR Character(30) VARCHAR2(30) NOT NULL Description