mysql如何加入两个表? [英] How to join two tables mysql?

查看:40
本文介绍了mysql如何加入两个表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两张桌子:

  • id
  • 客户
  • 服务

  • id
  • 姓名
  • 电子邮件

如何列出表服务并汇集客户表的客户名称?表中的字段customer services 有customer 表中的customer id,

How to list table service and bring together the customer name that the customers table? field customer services in the table has the id of the customer at the customer table,

感谢您的帮助

推荐答案

SELECT * FROM table1 LEFT JOIN table2 on table1.id = table2.id

这篇关于mysql如何加入两个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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