SELECT

TBL_COMPANY.COMPANYID,
NAME,
LINE1 as adress,
LINE2,
LINE3,
CITY,
STATE,
POSTALCODE as zip,
COUNTRYNAME as countryid,
WEBADDRESS,
DIVISION,
REGION,
TERRITORY,
REVENUE,
SICCODE,
INDUSTRY,
NUMEMPLOYEES,
CATEGORY,
DESCRIPTION,
TBL_COMPANY.CREATEDATE,
TBL_CREATE_USER.CONTACTID as CREATECONTACTID,
TBL_MANAGE_USER.CONTACTID as MANAGECONTACTID

FROM
TBL_COMPANY
LEFT JOIN TBL_ADDRESS ON TBL_COMPANY.COMPANYID = TBL_ADDRESS.COMPANYID
LEFT JOIN TBL_USER AS TBL_CREATE_USER ON TBL_CREATE_USER.USERID = TBL_COMPANY.CREATEUSERID
LEFT JOIN TBL_USER AS TBL_MANAGE_USER ON TBL_MANAGE_USER.USERID = TBL_COMPANY.MANAGEUSERID
