您的位置:首页 >如何定义MySQL的联合查询?
发布于2023-04-30 阅读(0)
扫一扫,手机访问
1、又称连接查询,连接多个表中的数据,获得结果集。当一个表不能满足查询结果时,需要使用联合查询。
2、前提,联合表之间必须有逻辑相关性。
实例
-- 示例: select orders.order_id, orders.amt, customer.cust_name, customer.tel_no from orders, customer where orders.cust_id = customer.cust_id; -- 起别名 select a.order_id, a.amt, b.cust_name, b.tel_no from orders a, customer b where a.cust_id = b.cust_id;
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
正版软件
正版软件
正版软件
正版软件
正版软件
1
2
3
7
9