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

查看:231
本文介绍了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天全站免登陆