--condition Comparison/*=,! =,<>,<,>,<=,>=,any,some,allis Null,is not Nullbetween x and Yin (list), not In (list) exists (sub-query) Like _,%,escape ' ' _\% escape ' \ '*/--any some can select E.ename, e.job,e.sal from EMP E where e.sal as long as any one of them is satisfied> Any (1000,2000,3000) SELECT E.ename, e.job,e.sal from EMP E WHERE e.sal> SOME (1000,2000,3000)--all satisfies all the select E.ename, e.job,e.sal from EMP E WHERE e.sal< All (1000,2000,3000) SELECT E.ename, e.job,e.sal from EMP E WHERE e.sal> All (1000,2000,3000)--Determine if NULL cannot be used for "="SELECT E.* FROM EMP E WHERE e.comm=null; --no data select E.* FROM EMP E WHERE null=null--no data select E.*From EMP E WHERE E.comm is NULL; SELECT E.*From EMP E WHERE e.comm are not NULL;--and= and Or=or, between and between the two select T.* FROM t_three_killed T WHERE t.c_age >= and t.c_sex = ' Male '; SELECT T.* FROM t_three_killed T WHERE t.c_age = OR T.c_age = 31; SELECT T.* FROM t_three_killed T WHERE t.c_age between and 33;--in EXISTS difference--in iterates through all the data in the table table and matches the criteria, and using in when the subquery data is large makes the query less efficient select T.*From t_three_killed T where T.c_age in (SELECT r.c_age from t_three_killed R WHERE r.c_age between33 and); --EXISTS as long as the query statement can return a single piece of data, the entire expression is true and applies to more subquery data, select T.*From t_three_killed T where EXISTS (SELECT r.c_age from t_three_killed R WHERE t.c_age=R.c_age and R.c_age between33 and);--Like fuzzy query escape escape character--in a pattern, the wildcard is interpreted as a normal character SELECT T when the escape character is placed before the wildcard character.* FROM t_three_killed T WHERE t.c_name like '%l\%% ' escape (' \ ');--There are four main functions in Oracle that support regular expressions:--Regexp_like: Similar to the function of like--Regexp_instr: Similar to the function of INSTR--Regexp_substr: Similar to the function of SUBSTR--regexp_replace: Similar to the function of REPLACE
Differences between Oracle between, all, in, and exists, fuzzy queries, 4 regular expressions