Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use using of Mysql

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of how to use Mysql's using, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this article on how to use using in Mysql. Let's take a look at it.

Example

In normal times, we usually do this when we query related tables.

Select * from Table 1 inner join Table 2 on Table 1. Same column = Table 2. Same column

And then you can change it to this, and it's the same effect.

The columns of select Table 1 from Table 1 inner join Table 2 on Table 1. Same column = Table 2. Same column

And then it can be changed to this.

Select * from Table 1 inner join Table 2 using (same column); first SELECT * FROM type,article where type.id=article.type_id

The second SELECT * FROM type inner join article on type.id=article.type_id

The third kind of SELECT type.*,article.* FROM type inner join article USING (id)

Table

CREATE TABLE `type` (`id` int (11) NOT NULL AUTO_INCREMENT COMMENT 'type number', `type_ name` varchar 'DEFAULT' 'COMMENT' article type name', `order_ num` int (11) NOT NULL DEFAULT '0custom icon, PRIMARY KEY (`id`) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT=' article type table' INSERT INTO `demo`.`type` (`id`, `icontoolset' name`, `order_ num`, `icon`) VALUES ('1demo,' front-end tutorials', '1demos,' iconclass-9'); INSERT INTO `demo`.type` (`id`, `type_ name`, `order_ num`, `icon`) VALUES ('2demos,' front-end tools', '2challenges,' icontoolset'); INSERT INTO `demo`.`type` (`id`, `type_ name`, `order_ num`, `icon`) VALUES ('3skills,' essays', '9cycles,' iconnote') CREATE TABLE `introducle` (`id`int (11) NOT NULL AUTO_INCREMENT, `type_ id` int (11) DEFAULT'0' COMMENT 'article type number', `title`varchar 'DEFAULT' 'COMMENT' article title', 'article_ content`text COMMENT' article main content', `introduce`text COMMENT 'article introduction', `add_ `timetime`DEFAULT NULL COMMENT 'article release time', `view_ count`int (11) DEFAULT'0' COMMENT 'browsing times' PRIMARY KEY (`id`) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT=' article content table' INSERT INTO `demo`.`accounle` (`id`, `demo`id`, `title`, `article_ content`, `introduce`, `add_ time`, `view_ count`) VALUES ('1cycles,' 1cycles, 'Vue3.x life cycle and hook functions' '# brief description\ r\ n\ r\ n-user registration interface\ r\ n\ r\ n\ nrequest URL\ r\ n-`http://xx.com/api/user/register`\ n\ r\ nrequest method\ r\ n-POST\ r\ n\ n parameter\ r\ n\ n | Parameter name | Yes | Type | description |\ r\ n |-- |:-- |-- | |:-|-|\ r\ n | username | Yes | string | user name |\ r\ n | password | Yes | string | password |\ r\ n | name | No | string | nickname |\ r\ n\ r\ n``\ r\ n {\ r\ n\ "error_code\": 0 \ r\ n\ "data\": {\ r\ n\ "uid\":\ "1\",\ r\ n\ "username\":\ "12154545\",\ r\ n\ "name\":\ "Wu system hang\",\ r\ n\ "groupid\": 2,\ r\ n\ "reg_time\":\ "1436864169\" \ r\ n\ "last_login_time\":\ "0\",\ r\ n}\ r\ n``\ r\ n\ r\ n return parameter description\ r\ n\ r\ n | Parameter name | description |\ r\ n |:-|-|\ r\ n | groupid | user group id 1: Super Admin 2: ordinary user |\ r\ n\ r\ n# remarks\ r\ n\ r\ n-for more error codes returned, please see the error code description on the front page', 'Vue3.x life cycle', '1640069422 codes,' 2') INSERT INTO `demo`.`accounle` (`id`, `demo`id`, `title`, `article_ content`, `introduce`, `demo`time`, `view_ count`) VALUES ('3percent,' 3percent, 'Redis + NodeJS) implements an asynchronous task queue system that can handle massive data.' in the recent business, we have received a requirement to process about 100, 000 pieces of data. The data is given as strings, and the steps to process them are asynchronous and time-consuming (it takes an average of 25 seconds to process a piece of data). If implemented in a serial way, it takes a long time:', 'Asynchronous Task queue system', '1640069422,' 15'); this is the end of the article on "how to use using for Mysql". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use Mysql's using". If you want to learn more, you are 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report