Home > Database > Mysql Tutorial > mysql自联结

mysql自联结

WBOY
Release: 2016-06-07 16:37:36
Original
1351 people have browsed it

mysql的 自联结 的处理速度比子查询快了很多。所以自联结还是有必要学习的。 普通的s ql子查询语句 SELECT `id`,`bic` FROM `biao` WHERE `id`=(SELECT `id` FROM `biao` WHERE `id`='9696e'); mysql的自联结sql语句 SELECT `id`,`bic` FROM `biao` AS a, `b

mysql的自联结的处理速度比子查询快了很多。所以自联结还是有必要学习的。
普通的sql子查询语句

SELECT `id`,`bic` FROM `biao` WHERE `id`=(SELECT `id` FROM `biao` WHERE `id`='9696e');
Copy after login

mysql的自联结sql语句

SELECT `id`,`bic` FROM `biao` AS a, `biao` AS b WHERE a.id=b.id AND b.id='9696e';
Copy after login

自联结的sql语句看起来也清爽优美。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template