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
Table of contents Preface Install vue-i18n Config...
There are already many articles about slot-scope ...
1. Uninstall npm first sudo npm uninstall npm -g ...
In the later stage of exploiting SQL injection vu...
Since its launch in 2009, flex has been supported...
Preface View is a very useful database object in ...
Effect (source code at the end): accomplish: 1. D...
The domestic market still has a certain demand fo...
What I want to share today is to use native JS to...
Sprite Cow download CSS Lint download Prefixr dow...
Linux system version: CentOS7.4 MySQL version: 5....
This article shares the specific code of JS to ac...
This article shares the installation and configur...
Table of contents Preface Preliminary preparation...
A while ago, I wrote a blog post titled "Can...