--Simple Case functionCase SexWhen ' 1 ' THEN ' male 'When ' 2 ' THEN ' woman 'Else ' other ' end--case search functioncase when sex = ' 1 ' THEN ' man 'When sex = ' 2 ' THEN ' female 'Else ' other ' end
In both of these ways, you can achieve the
Next
4. Conditional SelectionUPDATE.
For example, the following update conditions are available:
For employees with a salary of more than 5000, the salary is reduced by 10%.
Employees with salaries between 2000 and 4600 increase by 15%
You can
-- Simple Case FunctionCASE sexWHEN '1' THEN 'male'WHEN '2' THEN 'female'ELSE 'others' END-- Case search functionCase when sex = '1' THEN 'male'WHEN sex = '2' THEN 'female'ELSE 'others' END
These two methods can achieve the same function. Simple
-- Simple Case FunctionCASE sexWHEN '1' THEN 'male'WHEN '2' THEN 'female'ELSE 'others' END-- Case search functionCase when sex = '1' THEN 'male'WHEN sex = '2' THEN 'female'ELSE 'others' END
These two methods can achieve the same function. Simple
C function pointer simple use case, function pointer use case
(1) function pointer:Pointer to a function of the fixed parameter type and Return Value TypeStatement:Int fun (int, int)|\/Int (* pfun) (int, int)
Pfun is the function pointer
Select a. GCMC as fname, A. jsdw as fowner,CaseWhen B. FID is null then-1 else B. FID end as farea,A. content as fcontent, A. updatetime as ftime, null as fhref, A. deleted as fisdel
From z_bidding a left join ccic_area B on charindex (B. fname, A.
Function functions are very important in Javascript. The "Object-Oriented" of JS we usually discuss is based on it. It can be said that we should be quite familiar with it, it stores many unique places.
Every function is a function-type
Create a laravel5.1 project easy_grouping.
Composer Create-project Laravel/laravel easy_grouping 5.1.*
1. Multi-language TipsCreate a new directory ZH-CN in the Resources-lang directory, creating tip.php, as follows
' successful operation
Reprinted from http://lj.soft.blog.163.com/blog/static/7940248120109215191358/Case has two formats. Simple case function and case search function.--Simple case function when ' 1 ' then ' Male ' when ' 2 ' then ' women ' else ' other '
How to use case in SQL
Case has two formats. Simple case function and case search function.
Copy Code code as follows:
--Simple Case function
Case Sex
When ' 1 ' THEN ' male '
When ' 2 ' THEN ' woman '
Else ' other '
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
Case has two formats. Simple case function and case search function.--Simple case function when ' 1 ' then ' Male ' when ' 2 ' then ' women ' else ' other ' end--case search function case when sex = ' 1 ' Then ' man ' when
Transferred from: http://blog.sina.com.cn/s/blog_4c538f6c01012mzt.htmlCase has two formats. Simple case function and case search function.Simple Case function Sexwhen ' 1 ' then ' Male ' when ' 2 ' then ' women ' else ' other ' END--case search
Case has two formats. Simple case function and case search function.Simple Case Function CaseSexWhen ' 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 function Case Sex When ' 1 ' Then ' men ' When ' 2 ' then ' women ' Else ' other ' END --case search function case If sex = ' 1 ' Then ' man ' When sex = ' 2 '
Case has two formats. Simple case function and case search function.--Simple case function when ' 1 ' then ' Male ' when ' 2 ' then ' women ' else ' other ' end--case search function case when sex = ' 1 ' Then ' man ' when
Case has two formats. Simple case function and case search function.--Simple Case function Case Sex When ' 1 ' Then ' men ' When ' 2 ' then ' women ' Else ' other ' END --case search function case If sex = ' 1 ' Then ' man ' When sex = ' 2 '
--Simple case function when ' 1 ' then ' Male ' when ' 2 ' then ' women ' else ' other ' end--case search function case when sex = ' 1 ' Then ' man ' when Sex = ' 2 ' Then ' women ' else ' other ' ENDIn both of these ways,
SQL statement case when then else end returns a qualified value, sqlcase
Case has two formats
Simple Case functions and Case search functions:
-- Simple Case function CASE sex WHEN '1' then' male 'when' 2' then' female 'else' other 'ends -- Case
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.