mysql联合查询是什么

发布日期:2023-05-26 浏览次数:2

1、又称连接查询,连接多个表中的数据,获得结果集。当一个表不能满足查询结果时,需要使用联合查询。

2、前提,联合表之间必须有逻辑相关性。

实例

-- 示例:select orders.order_id, orders.amt, customer.cust_name, customer.tel_nofrom orders, customerwhere orders.cust_id = customer.cust_id; -- 起别名select a.order_id, a.amt, b.cust_name, b.tel_nofrom orders a, customer bwhere a.cust_id = b.cust_id;
如果您有什么问题,欢迎咨询技术员 在线沟通