我有一个工作正常的查询..
SELECT
WSDEFN.WORKSPACE_DISPLAY_NM,
LAYDEFN.LAYOUT_DISPLAY_NM,
WSLMAP.POSITION,
LAYDEFN.LAYOUT,
LAYDEFN.PROPORTION,
LAYDEFN.LAYOUT_ID,
WSDEFN.WORKSPACE_ID,
LAYDEFN.BUNDLE_KEY
FROM
WORKSPACE_DEFINITION WSDEFN,
WORKSPACE_LAYOUT_MAP WSLMAP,
LAYOUT_DEFINITION LAYDEFN
WHERE
WORKSPACE_ID = WSLMAP.WORKSPACE_ID
AND WSLMAP.LAYOUT_ID = LAYDEFN.LAYOUT_ID
AND WSDEFN.OD_USER_NO = '-1'
AND WSDEFN.OD_GCIF = '-1'
ORDER BY
wsdefn.workspace_id, WSLMAP.POSITION
但我想将WSDEFN.WORKSPACE_ID
取为WORKSPACE_ID
。
我试过这个
WSDEFN.WORKSPACE_ID AS WORKSPACE_ID,
但是我收到了错误
'列模糊定义'
你能给我一个解决方案吗?
答案 0 :(得分:3)
似乎缺少where子句中的表别名。
你尝试过这个吗? SELECT
WSDEFN.WORKSPACE_DISPLAY_NM,
LAYDEFN.LAYOUT_DISPLAY_NM,
WSLMAP.POSITION,
LAYDEFN.LAYOUT,
LAYDEFN.PROPORTION,
LAYDEFN.LAYOUT_ID,
WSDEFN.WORKSPACE_ID AS WORKSPACE_ID,
LAYDEFN.BUNDLE_KEY
FROM
WORKSPACE_DEFINITION WSDEFN,
WORKSPACE_LAYOUT_MAP WSLMAP,
LAYOUT_DEFINITION LAYDEFN
WHERE
WSDEFN.WORKSPACE_ID = WSLMAP.WORKSPACE_ID
AND
WSLMAP.LAYOUT_ID = LAYDEFN.LAYOUT_ID
AND
WSDEFN.OD_USER_NO='-1' AND WSDEFN.OD_GCIF='-1'
ORDER BY
wsdefn.workspace_id,WSLMAP.POSITION