目前我正在为我运行这个查询
SELECT `Sheet1$`.ACCT_CODE, `Sheet1$`.ACCTG_DATE, `Sheet1$`.AGENT_NO, `Sheet1$`.BAL_BOOK_CODE, `Sheet1$`.JRNL_ID_NO, `Sheet1$`.PRODUCT_CODE, `Sheet1$`.SOURCE_SYSTEM_ID, `Sheet1$`.`SUM(DR_CR_AMOUNT)`
FROM `Sheet1$` `Sheet1$`
WHERE (`Sheet1$`.BAL_BOOK_CODE='5092') AND (`Sheet1$`.ACCT_CODE Not Like '%H%') AND (`Sheet1$`.AGENT_NO='943776') OR (`Sheet1$`.BAL_BOOK_CODE='509A') AND (`Sheet1$`.ACCT_CODE Not Like '%H%') AND (`Sheet1$`.AGENT_NO='943776')
ORDER BY `Sheet1$`.ACCT_CODE
该查询给出的结果限于 AGENT_NO='943776'
而我想要显示的结果
- ACCT_CODE 不像 '%H%' 和
- 如果 AGENT_NO='943776' 那么 BAL_BOOK_CODE='509A' 或 BAL_BOOK_CODE='5092'
- 显示所有其他 AGENT_NO