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;
以上就是mysql联合查询怎么定义的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号