gpt4 book ai didi

php - SQL返回错误结果

转载 作者:行者123 更新时间:2023-11-30 00:09:49 26 4
gpt4 key购买 nike

enter image description here

如图所示,SQL 将返回特定用户 ID 的结果,但返回另一个 UID 的结果。

SELECT user_games.APPID, user_games.UID, user_games.type, games_xbox.logo_small, games_other.system, games_other.logo, COALESCE( games_steam.name, games_xbox.name, games_other.name ) AS name
FROM user_games
LEFT JOIN games_steam ON user_games.APPID = games_steam.APPID
LEFT JOIN games_xbox ON user_games.APPID = games_xbox.APPID
LEFT JOIN games_other ON user_games.APPID = games_other.APPID
WHERE user_games.UID = "LAnXQshTItjyifF8f"
AND games_steam.name LIKE "%%"
OR games_xbox.name LIKE "%%"
OR games_other.name LIKE "%%"
GROUP BY user_games.APPID

最佳答案

使用括号:

SELECT user_games.APPID, user_games.UID, user_games.type, games_xbox.logo_small, games_other.system, games_other.logo, COALESCE( games_steam.name, games_xbox.name, games_other.name ) AS name
FROM user_games
LEFT JOIN games_steam ON user_games.APPID = games_steam.APPID
LEFT JOIN games_xbox ON user_games.APPID = games_xbox.APPID
LEFT JOIN games_other ON user_games.APPID = games_other.APPID
WHERE user_games.UID = "LAnXQshTItjyifF8f"
AND (games_steam.name LIKE "%%"
OR games_xbox.name LIKE "%%"
OR games_other.name LIKE "%%")
GROUP BY user_games.APPID

关于php - SQL返回错误结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24173460/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com