Get the App
SLTechnology News&Howtos  ›  Database  › 

Example Analysis of execution problems between max and where in mysql

Shulou Source: shulou.com Published: 2022-05-31 17:58:26 10月01日 Update

This article mainly introduces the example analysis of the execution problems between max and where in mysql. The article is very detailed and has certain reference value. Interested friends must read 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 contents of the article "example Analysis of execution problems between 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 questions examples analysis content conditions articles language value interest and at the same time guys partners math are in more thus knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple Docker Redmi Microsoft