First we create the database table: CREATE TABLE `t_demo` ( `id` int(32) NOT NULL, `name` varchar(255) DEFAULT NULL, `age` int(2) DEFAULT NULL, `num` int(3) DEFAULT NULL, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; Insert data:
MySQL case when usage SELECT *, CASE WHEN t.num >= 85 THEN 'excellent' WHEN t.num < 90 AND t.num>= 60 THEN 'generally' ELSE 'Failure' END AS level FROM t_demo t; Query structure: The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Nginx improves access speed based on gzip compression
>>: Vue implements start time and end time range query
On the mobile side, flex layout is very useful. I...
The following CSS class names starting with a num...
This article mainly focuses on the installation a...
First way: skip-grant-tables: Very useful mysql s...
The following analysis is about product design pr...
Table of contents 1. Some concepts of Tomcat –1, ...
The topic I want to share with you today is: &quo...
1. Delete the original mariadb, otherwise mysql c...
1. Download Download address: https://dev.mysql.c...
1. Business scenario introduction Suppose there i...
Table of contents 0. The kernel tree that comes w...
In MySQL, fields of char, varchar, and text types...
The <tbody> tag is used to define the style...
Index condition pushdown (ICP) is introduced in M...
Table of contents 1. Implicit conversion Conversi...