我有两个查找表,我想内部连接,但是我只想在我的数据表上左连接。
select * from CLIENT
LEFT JOIN [ENTRY]
on [ENTRY].ENTRY_CODE = CLIENT.CLIENT_COUNTY
and [ENTRY].ENTRY_RECD = 'A'
INNER JOIN [ENTRY_TYPES]
on [ENTRY_TYPES].ENTRY_TYPES_FileRecordID = [ENTRY].ENTRY_TYPE
and [ENTRY_TYPES].ENTRY_TYPES_CODE = 'COUNTY'
and [ENTRY_TYPES].ENTRY_TYPES_RECD = 'A'
where CLIENT_RECD = 'A'
因此,如果ENTRY_TYPES_FileRecordID = ENTRY_TYPE
失败,我不希望该ENTRY
记录可作为左连接项用于连接到CLIENT
.
上面代码在左连接上的编写方式ENTRY
就像一个内连接。