例如: 原表country mysql select * from country; ------------------------------------------ | id | name | population | area | language | ------------------------------------------ |1 | mySQL | 13 | 960| chinese | |2 | American | 4 |60 | Eng
例如:
原表country
mysql> select * from country;
+----+----------+------------+------+----------+
| id | name | population | area | language |
+----+----------+------------+------+----------+
| 1 | mySQL | 13 | 960 | chinese |
| 2 | American | 4 |60 | English |
| 3 | Japan | 89 | 30 | Jpanese |
| 4 | England | 2 | 300 | English |
+----+----------+------------+------+----------
原表library
mysql> select * from library;
+----+---------------+--------+-------+
| id | name | author | price |
+----+---------------+--------+-------+
| 1 | java范例大全 | 张帆 | 99 |
| 2 | mySQL | 潘凯华 | 50 |
| 3 | SQLserver2005 | 刘智勇 | 80 |
| 4 | mySQL | 李慧 | 50 |
+----+---------------+--------+-------+
mysql> select area,author from country,library where country.name=library.name;
+------+--------+
| area | author |
+------+--------+
| 960 | 潘凯华 |
基于PHP+MYSQL开发,除了网上书店必备的商品管理、配送支付管理、订单管理、会员分组、会员管理、查询统计和多项商品促销功能,还具有完整的文章、图文、下载、单页、广告发布等网站内容管理功能。系统具有静态HTML生成、UTF-8多语言支持、可视化模版引擎等技术特点,支持多频道调用不同模版和任意设置频道首页,适合建立各种规模的网上书店。系统具有以下主要功能模块: 网站参数设置 - 对网站的一些参数进
3
| 960 | 李慧 |
+------+--------+
mysql> select language,area,author from country left join library on country.name=library.name; //返回的结果除内连接的数据外,还包括左表中不符合条件数据
+----------+------+--------+
| language | area | author |
+----------+------+--------+
| chinese | 960 | 潘凯华 |
| chinese | 960 | 李慧 |
| English | 60 | NULL |
| Jpanese | 30 | NULL |
| English | 300 | NULL |
+----------+------+--------+
mysql> select language,area,author from country right joinlibrary on country.name=library.name; // //返回的结果除内连接的数据外,还包括右表中不符合条件数据
+----------+------+--------+
| language | area | author |
+----------+------+--------+
| NULL | NULL | 张帆 |
| chinese | 960 | 潘凯华 |
| NULL | NULL | 刘智勇 |
| chinese | 960 | 李慧 |
+----------+------+--------+
mysql>select population,area,author,price from country,library where country.name=library.name and price>30;
mysql> select * from country wherename in(select name from library);
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号