MySQL 从一个表中选择所有列,从另一个表中选择一些列 [英] MySQL Select all columns from one table and some from another table

查看:49
本文介绍了MySQL 从一个表中选择所有列,从另一个表中选择一些列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 JOIN 从一个表中选择所有列,而从另一个表中仅选择一些列?在 MySQL 中.

How do you select all the columns from one table and just some columns from another table using JOIN? In MySQL.

推荐答案

就用表名:

SELECT myTable.*, otherTable.foo, otherTable.bar...

这将选择 myTable 中的所有列以及 otherTable 中的 foobar 列.

That would select all columns from myTable and columns foo and bar from otherTable.

这篇关于MySQL 从一个表中选择所有列,从另一个表中选择一些列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆