SELECT permission.bit,permission.name
FROM user
LEFT JOIN permission ON user.role & permission.bit
WHERE user.id = 1
我有這樣的查詢,我得到這個錯誤:建立出錯在SQL中加入
Msg 4145, Level 15, State 1, Line 3
An expression of non-boolean type specified in a context where a condition is expected, near 'bit'.
'ON user.col = permiss.col'並使用'AND'代替'&'加入條件 – lad2025
對不起是一個錯字 –