MySQL database query operation

Source: Internet
Author: User

Data Query Language


SELECT column name 1, column Name 2 ... from table name [where condition]

Query all fields use * to isolate all records of a table without a Where condition


=//Assignment and judgment are

! = <>//Two types not equal to

< > <= >=

OR OR | |

and &&

Between 5 and 10

Inch

Not in

Like '% value% '


For some simple queries, take the user table for example, sex-"0 for Male, 1 for female

    1. Query all

Sleect * from user

2. Query for data with age 33

SELECT * from user where age=33;

3. Query sex is not a male data

SELECT * from user where sex!=0;

4. Querying for data older than 30

SELECT * from user where age>30

5. Query for age=30 or age=40 data

SELECT * from user where age=30 or age=40;

6. Querying age=40 and user_name=liming data

SELECT * from user where age=40 and user_name= ' liming ';

MySQL database query operation

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.