仅从左联接的表中选择一些列

编程入门 行业动态 更新时间:2024-10-27 00:32:12
本文介绍了仅从左联接的表中选择一些列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否可以在 LEFT JOIN 的表中只选择一些列?

Is it possible to select only some columns from a table on a LEFT JOIN?

推荐答案

当然.只需像在任何查询中一样列出您要选择的列:

Of course. Just list the columns you want to select as you would in any query:

SELECT table1.column1, table1.column2, table2.column3 FROM table1 LEFT JOIN table2 ON (...)

请注意,我在所有列中都包含了 table1. 或 table2. 前缀,以确保在其中存在同名字段时不会出现任何歧义两个表.

Note that I've included the table1. or table2. prefix on all columns to be sure there aren't any ambiguities where fields with the same name exist in both tables.

更多推荐

仅从左联接的表中选择一些列

本文发布于:2023-10-20 22:28:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1512326.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!