mysql联合查询是什么

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

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

实例

--示例:
selectorders.order_id,orders.amt,customer.cust_name,customer.tel_no
fromorders,customer
whereorders.cust_id=customer.cust_id;

--起别名
selecta.order_id,a.amt,b.cust_name,b.tel_no
fromordersa,customerb
wherea.cust_id=b.cust_id;
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。