mysql如何连接两个表?

发布于 2024-09-15 04:58:28 字数 250 浏览 10 评论 0原文

我有两个表:

services

  • id
  • client
  • service

clients

  • id
  • name
  • email

如何列出表服务并将客户表中的客户名称汇总在一起?表中的字段客户服务有客户表中客户的 id,

非常感谢您现在的帮助

I have two tables:

services

  • id
  • client
  • service

and

clients

  • id
  • name
  • email

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,

I appreciate the help from you now

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

摇划花蜜的午后 2024-09-22 04:58:29
SELECT * FROM table1 LEFT JOIN table2 on table1.id = table2.id
SELECT * FROM table1 LEFT JOIN table2 on table1.id = table2.id
穿越时光隧道 2024-09-22 04:58:29
SELECT ...
FROM services AS s
JOIN clients AS c
  ON s.client = c.id
WHERE ...
SELECT ...
FROM services AS s
JOIN clients AS c
  ON s.client = c.id
WHERE ...
毅然前行 2024-09-22 04:58:29
SELECT ...
FROM services AS s
INNER JOIN clients AS c
  ON s.client=c.id
SELECT ...
FROM services AS s
INNER JOIN clients AS c
  ON s.client=c.id
天邊彩虹 2024-09-22 04:58:29

试试这个,

SELECT * from services as s INNER JOIN clients as c on s.id=c.id 

Try this,

SELECT * from services as s INNER JOIN clients as c on s.id=c.id 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文