MySQL INNER JOIN
来源:互联网 发布:js toggle() 编辑:程序博客网 时间:2024/06/01 09:17
MySQL INNER JOIN
inner join 连接的两个表,结果集是两个表的匹配的行。
语法
SELECT T1.c1, T1.c2, T2.cxFROM table1 T1INNER JOIN table2 T2ON T1.c1=T2.c1
示例
有products表和productlines表
mysql> describe products
-> ;
+——————–+————-+——+—–+———+——-+
| Field | Type | Null | Key | Default | Extra |
+——————–+————-+——+—–+———+——-+
| productCode | varchar(15) | NO | PRI | NULL | |
| productName | varchar(70) | NO | | NULL | |
| productLine | varchar(50) | NO | MUL | NULL | |
| productScale | varchar(10) | NO | | NULL | |
| productVendor | varchar(50) | NO | | NULL | |
| productDescription | text | NO | | NULL | |
| quantityInStock | smallint(6) | NO | | NULL | |
| buyPrice | double | NO | | NULL | |
| MSRP | double | NO | | NULL | |
+——————–+————-+——+—–+———+——-+
mysql> describe productlines;
+—————–+—————+——+—–+———+——-+
| Field | Type | Null | Key | Default | Extra |
+—————–+—————+——+—–+———+——-+
| productLine | varchar(50) | NO | PRI | NULL | |
| textDescription | varchar(4000) | YES | | NULL | |
| htmlDescription | mediumtext | YES | | NULL | |
| image | mediumblob | YES | | NULL | |
+—————–+—————+——+—–+———+——-+
两个表中有相同的列productLine
select productCode, productName, textDescription form products t1inner join productlines t2 on t1.productLine = t2.productLine;
- Mysql Inner Join , Outer Join
- MySQL Select-join、inner join
- mysql inner join性能
- MySQL INNER JOIN
- mysql inner join 查询
- mysql left join right join inner join
- mysql left join,right join,inner join
- Mysql-left join,right join,inner join
- mysql left join,right join,inner join
- mysql inner join 链接多个表
- MYSQL:INNER JOIN的用法
- MySQL left join快 inner join慢
- mysql left join,right join ,cross join inner join 用法
- MySQL| MySQL联接(INNER JOIN,LEFT JOIN,RIGHT JOIN)
- mysql left join,right join,inner join用法举例
- mysql操作 Left join , Right Join, Inner Join
- Mysql之inner join,left join,right join详解
- MySQL中的各种JOIN(CROSS JOIN, INNER JOIN, LEFT [OUTER]
- hdu5625 Clarke and chemistry
- 解决vim文件显示乱码问题
- .NET 环境中使用RabbitMQ
- lintcode: Fast Power
- 使用MySQL和Servlet编写Android接口样例
- MySQL INNER JOIN
- DiskLruCache的简单用法 .
- 泰国餐厅网站参考-hsj
- OGR数据模型
- 深入理解Java:注解(Annotation)基本概念
- 矩形嵌套(动态规划)
- Java -Xms -Xmx -Xss -XX:MaxNewSize -XX:MaxPermSize含义记录
- 简单的EasyUI登录界面
- butterKnife原理学习