Home >Database >Mysql Tutorial >Summary of SQL function definitions and usage

Summary of SQL function definitions and usage

巴扎黑
巴扎黑Original
2017-06-14 15:04:011308browse

The following editor will bring you a summary of the special processing statements of mysql's sql statements (must read). The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look. 1. Update the entire table. If the value of a column in a row of data is empty, then make it equal to the value of another column field UPDATE ot_tgbz set update_day=if(update_day is null, date, update_day); 2. Update the entire table. If a field is greater than 2, update them all to 2; UPDATE ot_user set xingyun_num=if(xingyun_num > 2,2,xingyun_num); 3. Change the shop_goods table Replace all URLs containing http://www.jb51.net/ in the thumb field with empty ones. update&am

1. 10 recommended articles about the statement collection

Summary of SQL function definitions and usage

##Introduction: The editor below will bring you a summary of the special processing statements of mysql's sql statements (must read). The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let's follow the editor to take a look. 1. Update the entire table. If the value of a column in a row of data is empty, then make it equal to the value of another column field UPDATE ot_tgbz set update_day=if(update_day is  ;null,date,update...

##2.

How to use multiple indexes? Summarize the usage of multiple index instances

Summary of SQL function definitions and usageIntroduction:  Index merging is not a new feature. It has been implemented as early as mysql version 5.0. The reason why I still write this blog post is because many people still have the misconception that one SQL statement can only use one index. Examples to illustrate how to use index merging. What is index merging? Let’s take a look at the mysql article...

##3. Summary of the points to note about index merging

Summary of SQL function definitions and usageIntroduction:  Multiple indexes Preface MySQL index merging is not a new feature. It has been implemented as early as MySQL version 5.0. The reason why I still write this blog post is because many people still have the error that one SQL statement can only use one index. Concept. This article will illustrate how to use index merging through some examples. What is index merging? Let’s take a look at mysql article...

##4. Recommended 10 index principle effects. (Collection)

Introduction: With its excellent performance, low cost, and abundant resources, MySQL It has become the preferred relational database for most Internet companies. Although it has excellent performance, the so-called "good horse comes with a good saddle". How to use it better has become a required course for development engineers. We often start from the job description. See requirements such as "Proficient in MySQL", "SQL Statement Optimization", "Understanding Database Principles", etc. We know that in general application systems, the read-write ratio is about 10:1, and insert operations and general update operations rarely have poor performance. The most encountered problems are also the easiest...Summary of SQL function definitions and usage

5. Detailed introduction to storage requirements

Introduction: Python comes with a lightweight relational database SQLite. This database uses SQL language. As a back-end database, SQLite can be used with Python to build websites or create tools that require data storage. SQLite is also widely used in other fields, such as HTML5 and mobile terminals. sqlite3 in the Python standard library provides an interface to this database. I will create a simple relational database to store book categories and prices for a bookstore. The database contains two tables: category is used for record classification, bo...

6. Detailed introduction to the optimization steps

Summary of SQL function definitions and usage

Introduction:  Implementation, in order to make myself more efficient in writing Mysql statements in the future, it is necessary to make a small summary of Mysql optimization. Step 1. Use the show status command to understand the efficiency of various SQL executions. The show [session|gobal] status session level indicates the statistics of the current connection results. The global level represents statistics since the last data...

7. Summary of graphical example usage

Summary of SQL function definitions and usage

Introduction: Detailed graphic and text explanation of using SQL statements to operate data tables (phpMyAdmin usage tutorial 3) Click the "SQL" button in the main interface of phpMyAdmin to open the SQL statement editing area. Enter a complete SQL statement to query, add, modify and delete data! In the previous article "Detailed graphic explanation of data table addition, deletion and modification operations (phpMyAdmin usage tutorial 2)", we introduced how to complete the operation, creation and deletion of data tables in the phpMyAdmin graphical management tool. Today we Let me introduce to you...

8. Summary of key points to note about view updates

Summary of SQL function definitions and usage

Introduction: The updateability of a view is related to the definition of the query in the view. 1. What are those in mysql that try to make it non-updatable? The following types of views are not updatable 1. SQL statements containing the following keywords: aggregate functions (sum, min, max, count), distinct, group by, having, union or uinon all 2. Constant views 3. Select contains sub Query 4.join 5.from a non-updatable attempt 6.The subquery of where clause refers to from...

9. Summary of courses on addition, deletion and modification operations

Summary of SQL function definitions and usage

Introduction: Detailed graphic and text explanation of using SQL statements to operate data tables (phpMyAdmin usage tutorial 3) Click phpMyAdmin Main Click the "SQL" button in the interface to open the SQL statement editing area and enter the complete SQL statement to implement data query, add, modify and delete operations! In the previous article "Detailed graphic explanation of data table addition, deletion and modification operations (phpMyAdmin usage tutorial 2)", we introduced how to complete the operation, creation and deletion of data tables in the phpMyAdmin graphical management tool. Today we Introducing to you...

10. 10 recommended articles about mysql_fetch_assoc()

Summary of SQL function definitions and usage

Introduction: mysql_connect() connects to the database mysql_select_db selects the database mysql_fetch_assoc() gets the result set mysql_query() executes the SQL statement example as follows:

【 Recommended related questions and answers]:

The pymysql execution of python3.5 prompts that the sql is successful, but it is not actually successful

spring - About keyword query Problems encountered: the problem of writing sql statements into java

php - How to optimize this sql

java - mybatis update Fails without reporting an error

php - Reading alias content

The above is the detailed content of Summary of SQL function definitions and usage. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn