1
當前查詢上沒有顯示這個查詢的一組現場參加:巢由
Select Name, Charge_code, Charge, Max(Mod)Mod, Max(date)Date
From Table1
Where Name is not Null and Name <>'' and Charge is not Null and charge_code is not null
Group by Name, Charge_Code, Charge
在這同一table1的我也有名爲「IDNUM」一個名稱標識號和一個單獨的表(表2 )我還在表2中的一個單獨的列中具有相同的標識符編號「IDNum」和位置標識。在表3中,我將該位置標識附加到實際位置名稱「location_Name」。這是我想加入我的數據集。
最後我想返回以下結果:
名稱|位置|收費代碼|收費| Mod |日期
如何將聯接嵌入到現有查詢中,以根據該標識符號碼撤回位置名稱,但不在結果中顯示標識號碼?對不起,如果這是一個簡單的問題,我是新的。 感謝
想這無濟於事:
提示:'JOIN'是做你想做的。 –
這就是我試過的,它沒有去。 選擇姓名,費用代碼,費用,最大(Mod)Mod,最大值(日期)日期,地點 從表1 加入位置table1.IDNum = Table2 .IDNum 其中名稱不爲空且名稱<>''且費用不爲空且charge_code不爲空 按名稱,費用代碼,費用分組 – Slipand
您忘記在'JOIN'後面加上'ON' – Mark