SELECT web_menu.menuref,
CASE WHEN ISNULL(menuname)
THEN web_menu.menuref
ELSE menuname END AS name
FROM web_menu
LEFT JOIN (SELECT menuref,menuname FROM web_menu_lang ) AS a ON (a.menuref=web_menu.menuref)
ORDER BY menuref ASC
Msg 174, Level 15, State 1, Line 2
The isnull function requires 2 argument(s).
Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'AS'.
Incorrect syntax near the keyword 'AS'. อาจจะไม่ได้ผิดที่ตัว AS ก็ได้นะ
SELECT web_menu.menuref,
CASE WHEN ISNULL(menuname) --> ISNULL(web_menu.menuname) ผิดตัวนี้ป่าวลองเปลี่ยนดูนะ
THEN web_menu.menuref
ELSE menuname END AS name
FROM web_menu
LEFT JOIN (SELECT menuref,menuname FROM web_menu_lang ) AS a ON (a.menuref=web_menu.menuref)
ORDER BY menuref ASC