相对最优:
SELECT ASSETCHANGEAPPLYINFO.*,ASSETCHANGEINFO.OPERATION
FROM
ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO
INNER JOIN ASSETCHANGEAPPLYINFO ON ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO.ASSET_CHANGE_APPLYINFO_ID = ASSETCHANGEAPPLYINFO.ID
LEFT JOIN ASSETCHANGEINFO ON ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO.ASSET_CHANGEINFO_ID=ASSETCHANGEINFO.ID
另外的方法:
SELECT a.*, ASSETCHANGEINFO.OPERATION
FROM (
SELECT * FROM ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO
INNER JOIN ASSETCHANGEAPPLYINFO ON ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO.ASSET_CHANGE_APPLYINFO_ID = ASSETCHANGEAPPLYINFO.ID) AS a
LEFT JOIN ASSETCHANGEINFO ON a.ASSET_CHANGEINFO_ID=ASSETCHANGEINFO.ID
SELECT ASSETCHANGEAPPLYINFO.*,ASSETCHANGEINFO.OPERATION
FROM
ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO,ASSETCHANGEAPPLYINFO,ASSETCHANGEINFO
WHERE ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO.ASSET_CHANGE_APPLYINFO_ID = ASSETCHANGEAPPLYINFO.ID
AND ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO.ASSET_CHANGEINFO_ID=ASSETCHANGEINFO.ID