当前位置: 代码网 > it编程>数据库>Mysql > MySQL多表关联查询join的四种类型及使用场景总结

MySQL多表关联查询join的四种类型及使用场景总结

2026年07月23日 • Mysql •我要评论
在现代数据库应用中,单一的数据表往往难以承载所有业务信息。为了构建更加灵活、高效和符合规范的数据库结构,我们通常会将相关的数据分散到多个表中,通过外键(foreign key)建立联系。这种设计模式被

在现代数据库应用中,单一的数据表往往难以承载所有业务信息。为了构建更加灵活、高效和符合规范的数据库结构,我们通常会将相关的数据分散到多个表中,通过外键(foreign key)建立联系。这种设计模式被称为“规范化”(normalization)。然而,当我们需要从这些分散的表中提取综合信息时,就需要使用多表关联查询(multi-table join query)。其中,join 语句是实现这一目标的核心工具。理解并熟练掌握 join 的不同类型及其适用场景,对于编写高效、准确的 sql 查询至关重要。本文将深入探讨 mysql 中最常用的四种 join 类型:inner join、left join、right join 和 full outer join(虽然 mysql 不直接支持,但可以通过 left join 和 right join 的组合模拟),并通过丰富的示例和 java 代码来帮助你掌握这些知识。 

什么是 join?

在关系型数据库中,join(连接)是一种操作,用于根据两个或多个表之间的相关列(通常是主键和外键)组合行。它允许我们从多个表中获取数据,并将它们组织成一个单一的结果集。

想象一下,我们有两个表:

customers表 (客户表)

idnameemail
1alice johnsonalice@example.com
2bob smithbob@example.com
3charlie browncharlie@example.com
4david wilsondavid@example.com

orders表 (订单表)

idcustomer_idproductquantityorder_date
11laptop12023-01-15
22mouse22023-01-16
31keyboard12023-01-17
43monitor12023-01-18
55headphones12023-01-19

在这个例子中,orders 表中的 customer_id 字段是 customers 表中 id 字段的外键。通过这个关联,我们可以将客户信息和他们的订单信息结合起来。

🧠 核心概念:

  • 主表 (left table):通常指 from 子句后面的表。
  • 从表 (right table):通常指 join 子句后面的表。
  • 连接条件 (join condition):on 子句中定义的用于关联两个表的条件,例如 customers.id = orders.customer_id。

inner join:只取交集 

定义与工作原理

inner join 是最常用的一种 join 类型。它返回两个表中都存在匹配记录的行。换句话说,只有当左表(主表)和右表(从表)的连接条件都满足时,才会将这两行的数据合并成一行输出。如果某行在其中一个表中找不到匹配项,则该行不会出现在最终结果集中。

语法

select columns
from table1
inner join table2 on table1.column = table2.column;

示例

让我们查询所有有订单的客户及其订单信息:

select c.name, c.email, o.product, o.quantity, o.order_date
from customers c
inner join orders o on c.id = o.customer_id;

结果

nameemailproductquantityorder_date
alice johnsonalice@example.comlaptop12023-01-15
alice johnsonalice@example.comkeyboard12023-01-17
bob smithbob@example.commouse22023-01-16
charlie browncharlie@example.commonitor12023-01-18

🧠 解释:

  • alice johnson 有两条订单(laptop 和 keyboard),所以输出两行。
  • bob smith 有一条订单(mouse),输出一行。
  • charlie brown 有一条订单(monitor),输出一行。
  • david wilson 没有订单,因此在 orders 表中找不到匹配项,所以不会出现在结果中。
  • orders 表中 customer_id = 5 的订单(headphones)也因为 customers 表中没有 id = 5 的客户而被排除。

与 where 子句的比较

虽然 inner join 可以通过 where 子句实现类似的效果,但 join 语句通常更清晰、性能更好。

-- ❌ 使用 where 实现(效率较低,可读性差)
select c.name, c.email, o.product, o.quantity, o.order_date
from customers c, orders o
where c.id = o.customer_id;

-- ✅ 使用 inner join (推荐方式)
select c.name, c.email, o.product, o.quantity, o.order_date
from customers c
inner join orders o on c.id = o.customer_id;

🧠 记住:inner join 是寻找两个表共同拥有的数据。

java 示例:使用 inner join

import java.sql.*;
import java.util.arraylist;
import java.util.list;

public class innerjoinexample {

    public static void main(string[] args) {
        string url = "jdbc:mysql://localhost:3306/ecommerce_db?usessl=false&servertimezone=utc";
        string user = "root";
        string password = "password";

        try (connection conn = drivermanager.getconnection(url, user, password)) {
            string sql = "select c.name, c.email, o.product, o.quantity, o.order_date " +
                         "from customers c " +
                         "inner join orders o on c.id = o.customer_id";

            preparedstatement stmt = conn.preparestatement(sql);
            resultset rs = stmt.executequery();

            list<orderedcustomer> results = new arraylist<>();
            while (rs.next()) {
                orderedcustomer customer = new orderedcustomer();
                customer.setname(rs.getstring("name"));
                customer.setemail(rs.getstring("email"));
                customer.setproduct(rs.getstring("product"));
                customer.setquantity(rs.getint("quantity"));
                customer.setorderdate(rs.getdate("order_date").tolocaldate());
                results.add(customer);
            }

            system.out.println("customers with orders (inner join):");
            for (orderedcustomer c : results) {
                system.out.println(c);
            }

        } catch (sqlexception e) {
            e.printstacktrace();
        }
    }
}

class orderedcustomer {
    private string name;
    private string email;
    private string product;
    private int quantity;
    private java.time.localdate orderdate;

    // getters and setters
    public string getname() { return name; }
    public void setname(string name) { this.name = name; }

    public string getemail() { return email; }
    public void setemail(string email) { this.email = email; }

    public string getproduct() { return product; }
    public void setproduct(string product) { this.product = product; }

    public int getquantity() { return quantity; }
    public void setquantity(int quantity) { this.quantity = quantity; }

    public java.time.localdate getorderdate() { return orderdate; }
    public void setorderdate(java.time.localdate orderdate) { this.orderdate = orderdate; }

    @override
    public string tostring() {
        return "orderedcustomer{" +
                "name='" + name + '\'' +
                ", email='" + email + '\'' +
                ", product='" + product + '\'' +
                ", quantity=" + quantity +
                ", orderdate=" + orderdate +
                '}';
    }
}

left join / left outer join:保留左表的所有记录

定义与工作原理

left join(或 left outer join)返回左表中的所有记录,以及右表中与之匹配的记录。如果右表中没有匹配的记录,则右表的字段将显示为 null。

语法

select columns
from table1
left join table2 on table1.column = table2.column;

示例

让我们查询所有客户及其订单信息,即使某些客户没有订单:

select c.name, c.email, o.product, o.quantity, o.order_date
from customers c
left join orders o on c.id = o.customer_id;

结果

nameemailproductquantityorder_date
alice johnsonalice@example.comlaptop12023-01-15
alice johnsonalice@example.comkeyboard12023-01-17
bob smithbob@example.commouse22023-01-16
charlie browncharlie@example.commonitor12023-01-18
david wilsondavid@example.comnullnullnull

🧠 解释:

  • 所有 customers 表中的客户都被列出。
  • alice johnson, bob smith, charlie brown 有订单,因此 o.product, o.quantity, o.order_date 显示具体值。
  • david wilson 没有订单,因此 o.product, o.quantity, o.order_date 显示为 null。

与 right join 的关系

left join 和 right join 是相对的。left join 保留左表,right join 保留右表。

java 示例:使用 left join

import java.sql.*;
import java.util.arraylist;
import java.util.list;

public class leftjoinexample {

    public static void main(string[] args) {
        string url = "jdbc:mysql://localhost:3306/ecommerce_db?usessl=false&servertimezone=utc";
        string user = "root";
        string password = "password";

        try (connection conn = drivermanager.getconnection(url, user, password)) {
            string sql = "select c.name, c.email, o.product, o.quantity, o.order_date " +
                         "from customers c " +
                         "left join orders o on c.id = o.customer_id";

            preparedstatement stmt = conn.preparestatement(sql);
            resultset rs = stmt.executequery();

            list<customerwithorders> results = new arraylist<>();
            while (rs.next()) {
                customerwithorders customer = new customerwithorders();
                customer.setname(rs.getstring("name"));
                customer.setemail(rs.getstring("email"));
                customer.setproduct(rs.getstring("product"));
                customer.setquantity(rs.getint("quantity"));
                customer.setorderdate(rs.getdate("order_date") != null ?
                        rs.getdate("order_date").tolocaldate() : null);
                results.add(customer);
            }

            system.out.println("all customers (left join - includes customers without orders):");
            for (customerwithorders c : results) {
                system.out.println(c);
            }

        } catch (sqlexception e) {
            e.printstacktrace();
        }
    }
}

class customerwithorders {
    private string name;
    private string email;
    private string product;
    private integer quantity; // 使用包装类型,可以为 null
    private java.time.localdate orderdate;

    // getters and setters
    public string getname() { return name; }
    public void setname(string name) { this.name = name; }

    public string getemail() { return email; }
    public void setemail(string email) { this.email = email; }

    public string getproduct() { return product; }
    public void setproduct(string product) { this.product = product; }

    public integer getquantity() { return quantity; }
    public void setquantity(integer quantity) { this.quantity = quantity; }

    public java.time.localdate getorderdate() { return orderdate; }
    public void setorderdate(java.time.localdate orderdate) { this.orderdate = orderdate; }

    @override
    public string tostring() {
        return "customerwithorders{" +
                "name='" + name + '\'' +
                ", email='" + email + '\'' +
                ", product='" + product + '\'' +
                ", quantity=" + quantity +
                ", orderdate=" + orderdate +
                '}';
    }
}

right join / right outer join:保留右表的所有记录

定义与工作原理

right join(或 right outer join)返回右表中的所有记录,以及左表中与之匹配的记录。如果左表中没有匹配的记录,则左表的字段将显示为 null。这在处理数据源时非常有用,特别是当你想确保从右表获取所有数据时。

语法

select columns
from table1
right join table2 on table1.column = table2.column;

示例

假设我们想找出所有订单及其对应的客户信息,即使订单号(id)在 customers 表中找不到对应客户(虽然在我们的示例中没有这种情况,但在实际业务中可能存在):

select c.name, c.email, o.id as order_id, o.product, o.quantity, o.order_date
from customers c
right join orders o on c.id = o.customer_id;

结果

nameemailorder_idproductquantityorder_date
alice johnsonalice@example.com1laptop12023-01-15
alice johnsonalice@example.com3keyboard12023-01-17
bob smithbob@example.com2mouse22023-01-16
charlie browncharlie@example.com4monitor12023-01-18
nullnull5headphones12023-01-19

🧠 解释:

  • 所有 orders 表中的订单都被列出。
  • alice johnson, bob smith, charlie brown 的订单都有对应的客户信息。
  • orders 表中的订单 id = 5 对应 customer_id = 5,但 customers 表中没有 id = 5 的客户,因此 c.name, c.email 显示为 null。

🚨 注意:在 mysql 中,right join 和 left join 互为镜像,可以通过交换表的顺序和使用 left join 来实现 right join 的效果。

-- 这两个查询等价
select c.name, c.email, o.product, o.quantity, o.order_date
from customers c
right join orders o on c.id = o.customer_id;

select c.name, c.email, o.product, o.quantity, o.order_date
from orders o
left join customers c on c.id = o.customer_id;

java 示例:使用 right join

import java.sql.*;
import java.util.arraylist;
import java.util.list;

public class rightjoinexample {

    public static void main(string[] args) {
        string url = "jdbc:mysql://localhost:3306/ecommerce_db?usessl=false&servertimezone=utc";
        string user = "root";
        string password = "password";

        try (connection conn = drivermanager.getconnection(url, user, password)) {
            // 使用 right join (等价于交换表顺序后的 left join)
            string sql = "select c.name, c.email, o.id as order_id, o.product, o.quantity, o.order_date " +
                         "from orders o " +
                         "left join customers c on c.id = o.customer_id";

            preparedstatement stmt = conn.preparestatement(sql);
            resultset rs = stmt.executequery();

            list<orderwithcustomer> results = new arraylist<>();
            while (rs.next()) {
                orderwithcustomer order = new orderwithcustomer();
                order.setcustomername(rs.getstring("name"));
                order.setcustomeremail(rs.getstring("email"));
                order.setorderid(rs.getint("order_id"));
                order.setproduct(rs.getstring("product"));
                order.setquantity(rs.getint("quantity"));
                order.setorderdate(rs.getdate("order_date") != null ?
                        rs.getdate("order_date").tolocaldate() : null);
                results.add(order);
            }

            system.out.println("all orders (right join - includes orders without matching customers):");
            for (orderwithcustomer o : results) {
                system.out.println(o);
            }

        } catch (sqlexception e) {
            e.printstacktrace();
        }
    }
}

class orderwithcustomer {
    private string customername;
    private string customeremail;
    private int orderid;
    private string product;
    private int quantity;
    private java.time.localdate orderdate;

    // getters and setters
    public string getcustomername() { return customername; }
    public void setcustomername(string customername) { this.customername = customername; }

    public string getcustomeremail() { return customeremail; }
    public void setcustomeremail(string customeremail) { this.customeremail = customeremail; }

    public int getorderid() { return orderid; }
    public void setorderid(int orderid) { this.orderid = orderid; }

    public string getproduct() { return product; }
    public void setproduct(string product) { this.product = product; }

    public int getquantity() { return quantity; }
    public void setquantity(int quantity) { this.quantity = quantity; }

    public java.time.localdate getorderdate() { return orderdate; }
    public void setorderdate(java.time.localdate orderdate) { this.orderdate = orderdate; }

    @override
    public string tostring() {
        return "orderwithcustomer{" +
                "customername='" + customername + '\'' +
                ", customeremail='" + customeremail + '\'' +
                ", orderid=" + orderid +
                ", product='" + product + '\'' +
                ", quantity=" + quantity +
                ", orderdate=" + orderdate +
                '}';
    }
}

full outer join:连接两个表的所有记录

定义与工作原理

full outer join 返回左表和右表中的所有记录。如果某条记录在另一张表中没有匹配项,则对应的字段将显示为 null。这种类型的 join 旨在合并两个表的所有数据。

mysql 中的限制

mysql 不直接支持 full outer join。但是,可以通过 left join 和 right join 的 union 操作来模拟其效果。

语法(模拟)

select columns from table1 left join table2 on condition
union
select columns from table1 right join table2 on condition;

示例

模拟 full outer join 查询所有客户及其订单信息(包括没有订单的客户和没有客户的订单):

-- 模拟 full outer join
select c.name, c.email, o.product, o.quantity, o.order_date
from customers c
left join orders o on c.id = o.customer_id

union

select c.name, c.email, o.product, o.quantity, o.order_date
from customers c
right join orders o on c.id = o.customer_id
where c.id is null; -- 确保只选择 left join 中未匹配的行

🧠 注意:上面的 union 查询会将两个 left join 和 right join 的结果合并,但由于 union 会自动去重,结果可能不完全等于 full outer join 的行为。更精确的模拟可能需要更复杂的逻辑或使用其他数据库系统。

实际效果

在我们的示例数据中,full outer join 的效果类似于 left join,因为 orders 表中的 customer_id = 5 没有在 customers 表中找到对应项,而 customers 表中的 david wilson 没有订单。如果 customers 表中还有其他没有订单的客户,或者 orders 表中有其他没有客户信息的订单,那么 full outer join 的效果会更明显。

🧠 实际应用:

  • 数据迁移/同步:比较两个表中所有记录的差异。
  • 数据审计:确保两个数据源的一致性。
  • 报表分析:需要全面了解两个表的数据状态。

java 示例:模拟 full outer join

import java.sql.*;
import java.util.arraylist;
import java.util.list;

public class fullouterjoinexample {

    public static void main(string[] args) {
        string url = "jdbc:mysql://localhost:3306/ecommerce_db?usessl=false&servertimezone=utc";
        string user = "root";
        string password = "password";

        try (connection conn = drivermanager.getconnection(url, user, password)) {
            // 模拟 full outer join
            string sql = "select c.name, c.email, o.product, o.quantity, o.order_date " +
                         "from customers c " +
                         "left join orders o on c.id = o.customer_id " +
                         "union " +
                         "select c.name, c.email, o.product, o.quantity, o.order_date " +
                         "from customers c " +
                         "right join orders o on c.id = o.customer_id " +
                         "where c.id is null";

            preparedstatement stmt = conn.preparestatement(sql);
            resultset rs = stmt.executequery();

            list<fulljoinresult> results = new arraylist<>();
            while (rs.next()) {
                fulljoinresult result = new fulljoinresult();
                result.setcustomername(rs.getstring("name"));
                result.setcustomeremail(rs.getstring("email"));
                result.setproduct(rs.getstring("product"));
                result.setquantity(rs.getint("quantity"));
                result.setorderdate(rs.getdate("order_date") != null ?
                        rs.getdate("order_date").tolocaldate() : null);
                results.add(result);
            }

            system.out.println("simulated full outer join results:");
            for (fulljoinresult r : results) {
                system.out.println(r);
            }

        } catch (sqlexception e) {
            e.printstacktrace();
        }
    }
}

class fulljoinresult {
    private string customername;
    private string customeremail;
    private string product;
    private integer quantity;
    private java.time.localdate orderdate;

    // getters and setters
    public string getcustomername() { return customername; }
    public void setcustomername(string customername) { this.customername = customername; }

    public string getcustomeremail() { return customeremail; }
    public void setcustomeremail(string customeremail) { this.customeremail = customeremail; }

    public string getproduct() { return product; }
    public void setproduct(string product) { this.product = product; }

    public integer getquantity() { return quantity; }
    public void setquantity(integer quantity) { this.quantity = quantity; }

    public java.time.localdate getorderdate() { return orderdate; }
    public void setorderdate(java.time.localdate orderdate) { this.orderdate = orderdate; }

    @override
    public string tostring() {
        return "fulljoinresult{" +
                "customername='" + customername + '\'' +
                ", customeremail='" + customeremail + '\'' +
                ", product='" + product + '\'' +
                ", quantity=" + quantity +
                ", orderdate=" + orderdate +
                '}';
    }
}

🚨 注意:在实际应用中,模拟 full outer join 可能会遇到性能问题,特别是在大数据集上。应根据具体需求权衡是否使用此方法。

join 的性能与优化

1. 索引的重要性

join 操作的性能很大程度上取决于连接字段上的索引。如果没有索引,数据库可能需要进行全表扫描来查找匹配项,这会非常慢。

-- 为连接字段创建索引
create index idx_orders_customer_id on orders(customer_id);
-- 或者在创建表时定义
alter table orders add constraint fk_customer_id foreign key (customer_id) references customers(id);

🧠 建议:确保连接字段(如 customer_id)上有索引。

2. 连接顺序

mysql 查询优化器通常会自动选择最优的连接顺序,但有时你可以通过 straight_join 关键字来强制指定连接顺序(不推荐,除非有特殊原因)。

select straight_join c.name, o.product
from customers c
join orders o on c.id = o.customer_id;

3. where 子句的优化

将过滤条件放在 where 子句中可以减少 join 操作的数据量,提高性能。

-- ✅ 在 where 中过滤,减少 join 的数据量
select c.name, o.product
from customers c
join orders o on c.id = o.customer_id
where o.order_date >= '2023-01-01';

-- ❌ 先 join 再过滤,可能效率低
select c.name, o.product
from customers c
join orders o on c.id = o.customer_id
where o.order_date >= '2023-01-01';

4. 使用 explain 分析

使用 explain 命令可以帮助你理解查询的执行计划,识别潜在的性能瓶颈。

explain select c.name, o.product
from customers c
join orders o on c.id = o.customer_id;

🧠 查看 type 列:all 表示全表扫描,ref 或 index 表示使用了索引。查看 key 列确认是否使用了正确的索引。

join 与其他 sql 子句的组合使用 🧩

1. join + where

select c.name, o.product, o.quantity
from customers c
inner join orders o on c.id = o.customer_id
where o.quantity > 1;

2. join + group by + having

select c.name, count(o.id) as total_orders
from customers c
left join orders o on c.id = o.customer_id
group by c.id, c.name
having total_orders > 1;

3. join + order by

select c.name, o.order_date
from customers c
inner join orders o on c.id = o.customer_id
order by o.order_date desc;

4. join + limit

select c.name, o.product
from customers c
inner join orders o on c.id = o.customer_id
limit 5;

join 的常见误区与注意事项

误区1:忘记在 join 中使用 on 条件

-- ❌ 错误!这会产生笛卡尔积(cross join)
select * from customers c, orders o;

-- ✅ 正确!
select * from customers c join orders o on c.id = o.customer_id;

误区2:混淆 join 的类型

-- ❌ 混淆了 left join 和 inner join 的结果
select c.name, o.product from customers c left join orders o on c.id = o.customer_id;

-- ✅ 如果只想看有订单的客户,应该用 inner join
select c.name, o.product from customers c inner join orders o on c.id = o.customer_id;

误区3:在 where 子句中使用连接字段的别名

-- ❌ 错误!别名在 where 子句中不可见
select c.name, o.product from customers c join orders o on c.id = o.customer_id
where c.id = 1;

-- ✅ 正确!
select c.name, o.product from customers c join orders o on c.id = o.customer_id
where customers.id = 1; -- 或者使用表名

误区4:不理解 null 值对 join 的影响

-- 如果连接字段是 null,通常不会匹配任何行
-- 例如,如果 orders.customer_id 为 null,即使 customers.id 也为 null,
-- 也不会在 inner join 中匹配,因为 null = null 为 unknown。

实际应用场景

1. 电商系统 - 用户与订单

  • 场景:展示用户购买历史。
  • join 类型:left join 或 inner join。
  • 目的:获取用户信息和其订单详情。

2. 学校管理系统 - 学生与成绩

  • 场景:查看所有学生的考试成绩,包括尚未参加考试的学生。
  • join 类型:left join。
  • 目的:确保所有学生信息都被列出,即使没有成绩。

3. 图书馆系统 - 读者与借阅记录

  • 场景:统计每个读者的借阅次数。
  • join 类型:left join。
  • 目的:包括没有借阅记录的读者。

4. 人力资源系统 - 员工与部门

  • 场景:获取员工及其所属部门信息。
  • join 类型:left join。
  • 目的:显示所有员工,包括那些暂时未分配部门的员工。

5. 日志分析 - 用户行为与事件

  • 场景:分析特定用户的行为路径。
  • join 类型:inner join。
  • 目的:只关注有明确用户id的事件。

join 的高级技巧

1. 自连接 (self-join)

有时你需要将一个表与自身进行连接,例如查找员工及其经理的信息。

-- 假设有一个员工表,包含 manager_id 指向同一表中的其他员工
create table employees (
    id int primary key,
    name varchar(100),
    manager_id int,
    foreign key (manager_id) references employees(id)
);

-- 查询员工及其经理
select e.name as employee, m.name as manager
from employees e
left join employees m on e.manager_id = m.id;

2. 多表连接

join 可以连接多个表。

select c.name, o.product, p.category
from customers c
join orders o on c.id = o.customer_id
join products p on o.product_id = p.id;

3. 使用子查询进行连接

select c.name, o.product
from customers c
join orders o on c.id = o.customer_id
where o.product in (
    select product_name from product_catalog where category = 'electronics'
);

总结:join 是数据库的灵魂

join 是连接不同数据表、提取综合信息的核心手段。理解并熟练掌握 inner join、left join、right join 以及如何模拟 full outer join,是你成为优秀数据库开发者的基石。

  • inner join:查找两个表中都存在的数据。
  • left join:保留左边表的所有数据,右边表匹配则显示,不匹配则为 null。
  • right join:保留右边表的所有数据,左边表匹配则显示,不匹配则为 null。
  • full outer join:在 mysql 中需通过 left join 和 right join 的 union 来模拟,用于获取两个表的所有数据。

在实际应用中,选择合适的 join 类型至关重要。它不仅影响查询结果的准确性,还直接关系到查询的性能。结合索引优化、合理的查询结构和 explain 分析,可以让你的数据库查询更加高效和健壮。

🌐 无论你是初学者还是资深开发者,掌握 join 的精髓,都能让你在处理复杂数据关系时游刃有余。正如 sql 之父 donald d. chamberlin 所说:“the power of sql lies in its ability to combine data from multiple sources.”(sql 的力量在于其能够整合来自多个来源的数据。)

参考资料(均可正常访问):

  1. mysql 8.0 reference manual - join syntax
  2. mysql 8.0 reference manual - join optimization
  3. w3schools sql joins
  4. sql join types - geeksforgeeks
  5. understanding joins in sql - stack overflow

✍️ 本文撰写于 2025 年,基于 mysql 8.0 版本。技术持续演进,请以官方最新文档为准。

mermaid 图表:join 类型对比 

mermaid 图表:join 执行流程 

总结

到此这篇关于mysql多表关联查询join的四种类型及使用场景总结的文章就介绍到这了,更多相关mysql多表关联查询join内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

赞 (0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2026  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com