Conditions are used to determine data values. A condition consists of one or multiple expressions and logical (Boolean) operators and returns TRUE, FALSE, or UNKNOWN.
Notice
The
NLS_COMPandNLS_SORTparameters jointly affect the sorting and comparison of characters. If you specifyLINGUISTICforNLS_COMPin the database, all entities mentioned in this development guide will follow the rule specified byNLS_SORT. If the value ofNLS_COMPis notLINGUISTIC, functions will not be affected byNLS_SORT. You can directly specify a value forNLS_SORT. If no value is specified for NLS_SORT, it will inherit the value ofNLS_LANGUAGE.
You can use conditions in the WHERE clause of the following SQL statements:
DELETESELECTUPDATE
You can use conditions in the following clauses of the SELECT statement:
WHERESTART WITHCONNECT BYHAVING
A condition can be known as a logical data type. For example, the result of the simple condition 1 = 1 is TRUE. The following example adds the values of salary and comm_pct (the NVL() function replaces the null values in salary with 0), and determines whether the sum of the values is greater than 2500.
NVL(salary, 0) + NVL(salary + (salary * comm_pct, 0) > 2500)
A logical condition, such as AND, can combine multiple conditions into one.
(1 = 1) AND (5 < 7)
Example of valid conditions in an SQL statement:
name = 'ALICE'
emp.deptno = dept.deptno
hire_date > '01-JAN-22'
job_id IN ('SA_MAN', 'SA_REP')
salary BETWEEN 5000 AND 8000
comm_pct IS NULL AND salary = 10000
The current version of OceanBase Database supports the following types of conditions: