Select query Statement 2

Source: Internet
Author: User

First, fuzzy query

1. Grammatical structure

Select *  from where column  like ' %context% '

If you do not use the wildcard "%" when you use the LIKE operator, then the action of the similar function is the same as = =

Three ways to use 2.%

(1) Start or end match

Put% in front of the matching character or you can query with .... Data at the beginning or end

(2) Intermediate matching

You can implement a fuzzy query by placing% on both ends of the matched character

(3) matching on both ends

Put% in the middle of the matching character, you can query the data with% before the content ending with% content

3. "_" wildcard characters

The "_" wildcard representation matches any one of the characters. Use "_" when you cannot determine the exact value of one or more of these characters.

4. "[]" wildcard characters

"[]" can specify a series of characters. "[]" is typically used in combination with a variety of other wildcard characters.

Second, operator query

1.and operator Query

(1) Grammatical structure

Select *  from where  and Condition2

(2) The AND operator is a logical operator, called a logical AND operator. The query must meet two criteria at a time.

2.or operator Query

(1) Grammatical structure

Select *  from where or Condition2

(2) The OR operator is also a logical operator, called a logical OR operator, that meets one of the criteria when querying

3.in operator Query

(1) Grammatical structure

Select *  from where column inch (value_list)

Value_list represents a value that matches a query

(2) In a query, you can use the in operator if you only need to satisfy one of the conditions in multiple conditions.

4.not in operator query

(1) Grammatical structure

Select *  from where column  not inch (value_list)

(2) Display the remaining data in the query that does not contain a matching value

Select query Statement 2

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.