我正在嘗試生成顯示計算機時代的報告。MySQL - 未知列字段列表
SELECT
M.NAME AS MACHINE_NAME,
M.CS_MODEL AS MODEL,
DA.SERVICE_TAG,
DA.SHIP_DATE,
M.USER_LOGGED AS LAST_LOGGED_IN_USER,
DW.SERVICE_LEVEL_CODE,
DW.SERVICE_LEVEL_DESCRIPTION,
DW.END_DATE AS EXPIRATION_DATE
FROM MACHINE M
JOIN DELL_ASSET DA ON (M.BIOS_SERIAL_NUMBER = DA.PARENT_SERVICE_TAG OR M.BIOS_SERIAL_NUMBER = DA.SERVICE_TAG)
JOIN (SELECT SERVICE_TAG, SERVICE_LEVEL_CODE, SERVICE_LEVEL_DESCRIPTION, MAX(END_DATE) from DELL_WARRANTY group by SERVICE_TAG, SERVICE_LEVEL_CODE, SERVICE_LEVEL_DESCRIPTION) DW ON DW.SERVICE_TAG = DA.SERVICE_TAG
WHERE M.CS_MANUFACTURER LIKE '%dell%'
AND M.BIOS_SERIAL_NUMBER!=''
AND DA.DISABLED != 1
AND DW.END_DATE < NOW()
AND DW.SERVICE_TAG IS NULL
;
上面的代碼產生了這個錯誤。我究竟做錯了什麼?
塊引用
錯誤代碼:1054未知列 'DW.END_DATE' 在 '字段列表'
請注意,「WHERE M.CS_MANUFACTURER LIKE'%dell%'」無法使用索引 – Strawberry