请帮我用连接写
(SELECT isvisibleforclients FROM user_assigned_packages WHERE (user_assigned_packages.UserID =
(SELECT ParentUserID FROM users WHERE users.UserID = UserID)))
答案 0 :(得分:2)
SELECT isvisibleforclients FROM user_assigned_packages uap
JOIN users us ON
uap.UserID = us.ParentUserID
AND us.UserID = UserID
假设您的代码中传递了 UserID 。
答案 1 :(得分:0)
试试这个...
SELECT
isvisibleforclients
FROM
user_assigned_packages a
inner join users b on a.UserID =b.ParentUserID and b.UserID = userID