gpt4 book ai didi

mysql - 如何只加入一列?

转载 作者:IT老高 更新时间:2023-10-28 23:44:22 26 4
gpt4 key购买 nike

SELECT * FROM table1
LEFT JOIN table2
ON table1.id = table2.table1_id
WHERE table1.id = 1

我只需要加入表 2 中的一列,比如 first_name。我该怎么做?

最佳答案

假设您的意思是“从表 2 中选择一列”:

   SELECT table1.*, table2.first_name
FROM table1
LEFT JOIN table2
...

关于mysql - 如何只加入一列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7219385/

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