标签: sql-server
SELECT a.COMPID ,a.A_COMPID ,a.A_CLIENTID ,a.A_CUSTNAME ,b.CLIENTID ,b.CLIENTNAME FROM A_CUSTOMERS AS a LEFT JOIN CLIENTS AS b ON b.COMPID = a.COMPID AND b.A_CLIENTID = a.A_CLIENTID WHERE a.COMPID = 1000