Get the App
SLTechnology News&Howtos  ›  Database  › 

Example Analysis of max and where in mysql

Shulou Source: shulou.com Published: 2022-05-31 21:54:10 10月04日 Update

This article mainly introduces the example analysis of max and where in mysql, which is very detailed and has certain reference value. Friends who are interested must finish it!

Implementation problems between mysql max and where

Perform sql:

CREATE TABLE `grades` (`id` int (20) NOT NULL AUTO_INCREMENT, `grades` int (20) NOT NULL, `grat` varchar (20) COLLATE utf8_bin DEFAULT NULL, `grades` varchar (20) COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;insert into `grades` (`id`, `gradesid`, `grat`, `grades`) values (1par 1pl 'Chinese', '80'), (2LQ' math', '89'), (3Jing' 2Zhi 'Chinese', '90') CREATE TABLE `student` (`id` int (20) NOT NULL AUTO_INCREMENT, `name` varchar (20) COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;insert into `student` (`id`, `name`) values

Execution result:

Implementation result 1:

Implementation result 2:

Implementation result 3:

Implementation result 4:

Implementation result 5:

Thus it can be seen that:

1.max is executed before the where condition

two。 And group by was executed before max.

3. When where and group by appear at the same time, the where condition is executed first.

The above is all the content of the article "sample Analysis of max and where in mysql". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Results examples analysis content conditions articles language value interest and at the same time guys partners math are in more thus knowledge industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Apple Shulou Tech Info macOS Huawei