In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you the "mysql three tables join to establish a view of the example analysis", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn the "mysql three tables join to establish a view of the sample analysis" of this article.
Three tables connect the a field of table A corresponds to the b field of B table, and the b1 field of B table corresponds to the c field of C table.
Now create a view, and you can see all the information of the three tables at the same time.
Create or replace view v_nameasselect t1.recording, recording t2.recording, recording from A Table T1, B Table T2, C Table t3where t1.a=t2.b and t2.b1=t3.c
Two tables are linked to create a view
CREATE TABLE `aa_ user` (`id` int (10) NOT NULL, `name` varchar (10) DEFAULT NULL, `age` int (10) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;INSERT INTO `aa_ user` VALUES ('1mm,' zs', '18'); INSERT INTO `aa_ user` VALUES (' 2mm, 'ls',' 20'); INSERT INTO `aa_ user` VALUES ('3mm,' ww', '19') CREATE TABLE `tb` (`id` int (10) NOT NULL, `fid` int (10) DEFAULT NULL, `cc` int (10) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;INSERT INTO `tb` VALUES ('1x,'1x, '60'); INSERT INTO `tb` VALUES (' 2th, '1th,' 70'); INSERT INTO `tb` VALUES ('3th,' 2th, '80'); INSERT INTO `tb` VALUES (' 44th, '2th,' 90')
Create a view
The above is all the contents of this article entitled "example Analysis of establishing View by joining three tables in mysql". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.