Get the App
SLTechnology News&Howtos  ›  Database  › 

How to query mysql statement

Shulou Source: shulou.com Published: 2022-06-01 01:40:59 09月24日 Update

This article mainly introduces how to query the mysql sentence, the article is very detailed, has a certain reference value, interested friends must read it!

The method of querying mysql statement: when querying records in a table, the code is [select * from table name where name='long' and age = '18'], from followed by table name, where followed by condition, select followed by filtered fields.

The method of querying the mysql statement:

When querying records in a table in mysql

The writing order is: select * from table name where name='long' and age = '18'

But the order of execution in mysql is

Add the table name after from to make sure you are the table.

Where is followed by conditions to filter the contents of the table by conditions.

Select is followed by some of the fields in the data filtered out by your where * all fields

# the result of query execution is also a table, which can be regarded as a virtual table

Let's create an employee table for emp

When we have a lot of fields, the layout of the results may be messy. We can add\ G to the end of the query statement to standardize the query results.

Select * from Table name\ G

How do we analyze when we encounter a demand? For example

1. Query data whose id is greater than or equal to 3 and less than 6

Let me show you the actual operation 1. First determine which table to come from from emp 2. Filter condition where id > = 3 and id = 3 and id = 3 and id

Tags: Query grouping field data department employee statement time function name character salary condition result salary minimum information content method valid Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Linux Shulou Technology OPPO Reno Microsoft