PL/SQL script language value assignment statement syntax table and record comply with the type usage, select the statement if else usage anonymous block (1), assign value statement syntax PL/SQL values use: = "=" some rules need to be observed in
You may be familiar with the IF Else statement, which is used to control the process. A CASE statement statement has a similar effect in the world of SQL. The following is a simple introduction to the use of case statements. Consider the following
There was a problem writing the Oracle stored procedure a while ago.Originally written like thisIf 1=2 ThenNullElseIf 1=3 ThenNullEnd If;The ElseIf does not change color in the PL/SQL editing environment, stating that it is not a keyword.Later
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
Back in the evening, the classmate said the interview encountered a SQL interview topic, did a bit of their own, summary summary.The topics are as follows: The following is a product data sheet (Product ID, color col, num), each of which is
Use of case, simple case functionA simple case expression that uses an expression to determine the return value.
Grammar:
Case Search_expression
When Expression1 THEN RESULT1
When Expression2 THEN result2
...
When Expressionn THEN Resultn
ELSE
IF ELSE StatementIF ELSE is one of the most basic programming statement structures in which almost every programming language supports this structure andIt is useful to check the data returned from the database for Transact-SQL using the IF ELSEThe
1 --declaring Variables2 Declare @age int3 Declare @name varchar( -)4 5 6 --Assignment (constant value)7 Set @age= -8 Select @name='Zhang San'9 Ten One --isolated from database and assigned value A Set @name=(SelectStudentname
If condition statement.Basic structure of an IF conditional statementIF ThenPL/SQL and statementsEND IF;or IF ThenPL/SQL and statementselse other statementsEND IF;DeclareCou Number: = &number;BeginIf Cou >10 ThenDbms_output.put_line (' cou= ' | |
--if ELSE--Features:--1. No {}, use Begin...end--2. There are multiple and nested--3.if must have a processing statement, and if there is only one sentence, you may not use begin. End, containing only the following sentence--4. No concept of
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.