Case has two formats. Simple case function and case search function.--Simple Case functionCase SexWhen ' 1 ' Then ' men 'When ' 2 ' then ' women 'Else ' other ' END--case search functioncase If sex = ' 1 ' Then ' man 'When sex = ' 2 ' Then ' women
Case has two formats. Simple case function and case search function.--Simple Case functionCase SexWhen ' 1 ' Then ' men 'When ' 2 ' then ' women 'Else ' other ' END--case search functioncase If sex = ' 1 ' Then ' man 'When sex = ' 2 ' Then ' women
The data SQL CASE expression is a generic conditional expression that resembles a if/else statement in another language.Case if condition then resultWhen condition then result.............[When ...][ELSE result]ENDThe case clause can be used where
Conditional statementsdelimiter \\CREATE PROCEDURE proc_if ()BEGIN declare i int default 0; if i = 1 THEN SELECT 1; ELSEIF i = 2 THEN SELECT 2; ELSE SELECT 7; END IF;END\\delimiter ;Looping statementsWhile
Use LOCATE and case when... THEN... ELSE... END in mysql in combination,
In the previous project, you need to write an SQL statement to find out A survey details. Select answer A, Answer B, and answer C... f. The number of people in the answer is
The great god says: In sql, you can use if else without casebelow to see, specifically why, did not figure out if there is a great God to know to provide the following information:MySQL can be used as an expression, or as a Process control statement
MySQL Stored Procedure example. You cannot use begin end in if else. Otherwise, an Error Code: 1064 is reported to solve the Error Code: 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the
MySQL Trigger if then ElseIf else's useCREATE PROCEDURE DBName.Proc_getgrade(Stu_no varchar(20),Cour_no varchar(10)) BEGINDECLARE Stu_gradeFloat; SelectGradeIntoStu_gradeFromGradewhereStudent_no=Stu_noandCourse_no=Cour_no; IfStu_grade>=90 Then
Before the project needs to write a SQL, is to find out a research details, choose a answer, b answer, c answer ... f The answer to how many people each, this SQL is also a great effort to write, it is written down, convenient for later use.Among
MySQL常用指令,java,php程序员,数据库工程师必备。程序员小冰常用资料整理MySQL common commands (for reference)The most common display commands are:1. Display the list of databases.show databases;2. Display the data table in the library:Use MySQL;Show tables;3, display the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.