gpt4 book ai didi

mysql - 如何更改此查询以使用连接?

转载 作者:行者123 更新时间:2023-11-30 21:54:46 25 4
gpt4 key购买 nike

SELECT breakgame, Streak,
((SELECT (maxGameId - gameId) as gameGap
FROM game_result
WHERE game_result.breakgame >= kokopam.game_streak.breakgame
ORDER BY gameId DESC LIMIT 1)/ Streak) as nowWeight
FROM kokopam.game_streak, (SELECT max(gameId) as maxGameId FROM game_result ORDER BY gameId DESC LIMIT 1) maxGameId
WHERE breakgame>= 2

如何更改此查询以使用连接?

请帮帮我

最佳答案

首先,您应该在“where”子句中有一个条件,说明行共享的 ID。

无论如何,您使用的方法与内部联接的工作原理相同。

Select * 
From tableA a, tableB b
Where a.id=b.id

相同
Select *
From tableA a
Inner join tableB b on b.id=a.id

如果您指定要在查询中执行的操作以及表中的列,我可以为您提供更多帮助。

关于mysql - 如何更改此查询以使用连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45666959/

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