Common Criteria for SQL statement judgment

Source: Internet
Author: User

Conditional judgment notation:

when performing actions on a daily record, judge the conditions that are restricted-----

operator :

= <> (mismatch check) ! = < > <= >=

Example: Products not produced by supplier 1003 Where vend_id<>1003

and two both meet

OR Two conditions in which one can be satisfied

Note: You should pay attention to the priority of both and and or when using And>or

For example: List all products priced at more than $10 and manufactured by 1002 or 1003?

Where vend_id=1002 or vend_id=1003 and prod_price>=10; This error

Where (vend_id=1002 or vend_id=1003) and prod_price>=10;

between and   

Prices for all products between $5 and $10

WHERE Prod_price between 5 and 10;

Like '%_ City% '

Percent percent (% )--any character, any number of occurrences,

Can be used anywhere in search mode, or multiple wildcard characters can be used

For example: Any word that begins with jet where prod_name like ' jet% ';

Underline (_)--match only a single character

Where prod_name like ' _ton anvil ';

In () within the range

Not in () out of range

Is null empty

Common Criteria for SQL statement judgment

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.