MySQL Common basic operation Syntax (v)--Simple conditional query on data "command line mode"

Source: Internet
Author: User
1. Single Condition query: Select field name from TableName where condition;

2, simple multi-criteria query, using && or between and etc.:

3, is null and is not NULL query, here to note that NULL is not an empty string not 0:

4, in and not in queries are equivalent to connecting the set elements behind in with or. Note that if NULL is present in the collection in the back band, the result is not affected, but there is null in the collection behind not, and no results are investigated, and no in also does not find null:

5. Like fuzzy query (not only for strings): The query begins or ends with a character or a few characters or the middle contains:%

If you want the opposite logic, you can use not, there are two slightly different ways of writing:

You can also use _ (underscore) as a placeholder, for example The following example indicates that the third letter is S (two underscores), the second letter is S (an underscore):

You can use not as well here.

MySQL Common basic operation Syntax (v)--Simple conditional query on data "command line mode"

Related Article

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.