Case has two formats: Simple case function and case search function.
-- Simple case Function
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Case sexWhen '1' then 'male'When '2' then 'female'Else '
Applicable sqlserver,oracleCaseWhen 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
Application and Implementation of SQL cross tabulation · programming learning · Network of Programming Technology Information
Static statement:Question:How to put the following formFitemid fname fstockid fdeptid fauxqty-------------------337
Question:
How to put the following formFitemid fname fstockid fdeptid fauxqty-------------------337 Production Department 598 327 1000.0337 packaging workshop 624 605 1000.0339 packaging workshop 598 605 200.0......Convert to this formFitemid:
Case-when usage, simple case functionA simple case expression that determines the return value using an expression.Grammar:Case Search_expressionWhen Expression1 then RESULT1When Expression2 then RESULT2...When Expressionn then RESULTNELSE
Case has two formats. Simple case function and case search function. --Simple case function case sex when ' 1 ' then ' Male ' when ' 2 ' then ' women ' else ' other ' END--case search function case when sex = ' 1 ' the N ' male ' when sex = ' 2 '
1. generate random seriesMethod 1Code:Randomize' updates reverse dataFuncation rand (k, n)N = int (k-1) * RND + 1)Rand = NEnd funcationMethod 2Code:N = randomnumber. Value (1,255)2When a row in the table is run, all data in the table is
We all know when the use of the case, once satisfied with a certain when, then this data will be withdrawn when, and no longer consider other case, the article detailed introduction of the case when the use and examples to explain. Case
Here is an example of using the case function to complete this function
Case has two formats. Simple case function and case search function.--Simple Case function
Case
Sex
When ' 1 ' then ' male '
When ' 2 ' Then ' woman '
Else '
1. generate random series Method 1
Code:
Randomize' updates reverse dataFuncation rand (k, n)N = int (k-1) * RND + 1)Rand = NEnd funcation
Method 2
Code:
N = randomnumber. Value (1,255)
2. When a row in the table is run, all data in the table is
Case 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 function case when sex = ' 1 ' Then ' man ' when sex = ' 2 ' Then '
The use of case--simple case function simple case expression, using an expression to determine the return value. Syntax: Case search_expression while expression1 then RESULT1 when expression2 Then result2 ... When Expressionn then Resultn ELSE
I. usage conditions,
1. When the bound field is in the bit type, you need to display the content according to the judgment and perform the following processing.
(1) processing on the ASPX page at the front end
Let's try again:
[authenticated] ":
1. The "class" statement must end with the matched "End Class ".
When the template is used, the above prompt appears inexplicably in vs2008. Create a file, select "use template", and copyCodeAfter!
2. In. net, usage: (transferred from
MySQL CASEWHEN statement usage instructions bitsCN.com
The case when Statement in the mysql database.
The case when statement is used to calculate the condition list and return one of multiple possible result expressions.
CASE has two formats:
The
Calculate the condition list and return one of multiple possible result expressions.
Case has two formats:
The simple case function compares an expression with a group of simple expressions to determine the result.
The case search
Case has two formats. Simple case function and case search function.
--Simple case function case
sex when
' 1 ' THEN ' man ' when
' 2 ' THEN '
Else ' other ' end
--case search function case when
sex = ' 1 ' THEN ' when
This article is a record of the programmer's SQL code, and this time it will cover other functions commonly used by SQL Server. (Other database is not listed here, want to see more attention to the "Programmer's SQL Code").
Other functions include:
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 '
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.