gpt4 book ai didi

Mysql怎么做到这一点?

转载 作者:行者123 更新时间:2023-11-29 15:05:17 25 4
gpt4 key购买 nike

我需要从表中选择记录,但一个字段(例如 id2)替换为其他表中的值,其中第一个表中的 id==id2

最佳答案

如果要从表中选择列值存在于另一个表列中的行,则需要使用 JOIN:

SELECT * FROM table1 INNER JOIN table2 ON table1.id = table2.id2

Read this blog post by Jeff Atwood on the different joins .

关于Mysql怎么做到这一点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2256199/

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