We all know the usage of case when. Once a certain when is satisfied, the data will exit the case when instead of considering other cases,ArticleTo introduce the usage of case when in detail and give an example. Case when usage-simple case function
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 sex = ' 2 '
First, mathematical functionsABS (x) returns the absolute value of XBIN (x) returns the binary of X (Oct returns octal, HEX returns hex)CEILING (x) returns the smallest integer value greater than XEXP (x) return value E (base of natural logarithm) x
I. mathematical functionsABS (x) returns the absolute value of x.BIN (x) returns the binary value of x (OCT returns octal, HEX returns hexadecimal)CEILING (x) returns the smallest integer greater than x.EXP (x) returns the x power of e (the base of
Data Control Language DCL)
Data Control Language (DCL) is a statement used to set or change database user or role permissions. These statements include GRANT, DENY, REVOKE, and other statements. By default, only members of sysadmin, dbcreator,
I. mathematical functions
ABS (x) returns the absolute value of X.Bin (x) returns the binary value of X (Oct returns octal, Hex returns hexadecimal)Ceiling (x) returns the smallest integer greater than X.Exp (x) returns the X power of E (the base
Mysql common function summary (share) bitsCN.com
The following describes common functions in mysql. For more information, see.
I. mathematical functionsABS (x) returns the absolute value of x.BIN (x) returns the binary value of x (OCT returns octal,
Case has two formats. Simple case function and case search function.Press CTRL + C to copy the codeIn both of these ways, the same functionality can be achieved. The simple case function is relatively concise, but there are some limitations to the
The case-when statement has two forms: a simple and a search case function.--Simple Case functionCase SexWhen' 1 'then man ' when ' 2 ' then female ' else Span style= "color:purple;" > ' then man when sex = ' 2 ' then woman " else other '
CaseWhen condition 1 then result 1When condition 2 then result 2When condition 3 then result 3When condition 4 then result 4.........When condition n then result nELSE result XENDCase has two formats. Simple case function and case search
MySql common functions such as mathematical functions and encryption functions bitsCN.com
MySql common functions, such as mathematical functions and encryption functions
There are many MySql functions. here we only list some common functions.
I.
I. mathematical functions ABS (x )?? Returns the absolute value BIN (x)? of x )?? Returns the binary value of x (OCT returns octal, HEX returns hexadecimal) CEILING (x )?? Returns the minimum integer EXP (x )?? Returns the x power FLOOR (x) of e
Use CaseThe case function is a special Transact-SQL expression that allows explicit optional values by column values. Changes in the data are temporary, and no permanent changes are made to the data. For example, the case function can display
Case has two formats. Simple Case functions and Case search functions.-- Simple Case FunctionCASE sex WHEN '1' THEN 'male' WHEN '2' THEN 'female'ELSE 'others' END-- Case search functionCase when sex = '1' THEN 'male' WHEN sex =
Case has two formats. Simple case functions and case search functions.1. Simple case Functions
Case sex when '1' then' male 'when' 2' then' female 'else' others' end
2. Case search functions
Case when sex = '1' then' male 'when sex
Mysql common functions, difficulties, notes, and difficulties of mysql Functions
I. mathematical functionsABS (x) returns the absolute value of x.BIN (x) returns the binary value of x (OCT returns octal, HEX returns hexadecimal)
CEILING (x) returns
SQL server's case when then statement, sqlcase
-- Select DataName,-- Case Code---- When 'w01' then 'male'---- When 'w07 'then' female'---- Else 'others'---- End as Code-- From dbo. HistoryData
Select DataName,(CaseWhen Code = 'w01' then 'male'When
MYSQL database function set
I. mathematical functionsABS (x) returns the absolute value of x.BIN (x) returns the binary value of x (OCT returns octal, HEX returns hexadecimal)
CEILING (x) returns the smallest integer greater than x.
EXP (x) returns
SQL uses case when then multi-condition judgment
Case When condition 1 then result 1 When condition 2 then result 2 When Condition 3 then result 3 When condition 4 then result 4......... When condition n then result n Else result
?? One, the string functionASCII (char) returns the ASCII code value of a characterBit_length (str) returns the bit length of a stringCONCAT (S1,S2...,SN) to concatenate s1,s2...,sn into a stringConcat_ws (SEP,S1,S2...,SN) joins the S1,S2...,SN as a
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.