Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to query mysql statement

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report