Differences between Oracle between, all, in, and exists, fuzzy queries, 4 regular expressions

Source: Internet
Author: User

--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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.