Advanced data filtering (like)

Source: Internet
Author: User

Single character filter ' _ '

SELECT * from T_employee where FName like ' _erry '

Multi-character filter '% '

SELECT * from T_employee where FName like ' t% '

Set match filter [JT]: Information for the first letter J or T

[^JT] Anti-collection: information for the first letter not J or T

SELECT * from T_employee where FName like ' [jt]% '

SELECT * from T_employee where FName like ' [^jt]% '

SQL query null value, can not directly use ordinary equals to judge, to use the keyword ' is null/is not null ', because some special settings in the database will not be queried

SELECT * from T_employee where Fage is null
SELECT * from T_employee where Fage are not null and fsalary>2000

Inverse operator '! = does not equal! < not less than ' three ways of expression '! ' Can only be used in SQL Server DB2 database

SELECT * from T_employee where fage!=23 and fsalary!<5000
SELECT * from T_employee where fage<>23 and fsalary>=5000
SELECT * from T_employee where not (fage=23) and not (fsalary<5000) not inverse operation

Advanced data filtering (like)

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.