SQL LAST () function
The selected column for the final value returned by the LAST () function.LAST () syntax
SELECT LAST(column_name) FROM table_name
Let's look at a simple example.
OrderDate
OrderPrice
Customer
This article introduces how to regularly and automatically back up website data and back up large databases in linux. For more information, see.
We can use commands and scripts to back up and restore common data. ,
1. Use commands to back up
There are many ways to implement automatic mysql backup. The most common method is mysql master-slave synchronization for data backup. below I will introduce to you a detailed explanation of mysql master-slave configuration for database
In mysql, alter is used to modify the data table structure. This is the same as the mssql method. Next I will introduce several instances of modifying data tables using alter.
Use the alter command in mysql to edit the table structure.
Modify Table
When I used freebsd for the first time, the result was that after the various passwords were configured, I could not remember the root password of mysql. Now I have folded it back and found a way to crack the mysql password, this requires the root
The storage location of the mysql database is stored in the C directory by default. It is usually stored in the db in linux, but we can modify the storage location of the mysql database files at any time, next, I will introduce the modification
The GROUP_CONCAT () function can be called a connection field in mysql. However, when we use the GROUP_CONCAT () function, we find that this function is not that simple. Next we will introduce the usage of GROUP_CONCAT.
Syntax:
The Code is
Generally, the server IP address cannot be changed at will. If the mysql Master/Slave fails to be changed, I will introduce the process of changing the IP address of the master server under MySQL Master/Slave replication.
All the servers of the
I opened the website early this morning and found that the dynamic page showed the ERROR 1040: Too connector connections prompt. This is not the reason for Too many connections. I don't have a few IP addresses in my blog every day, how can this
This article will introduce you to a more useful function, that is, to record the SQL statements executed by MySQL in real time, so that we can easily troubleshoot various injection problems.
The method is simple: edit/etc/my. in the cnf file, add
In the previous section, I talked about the SQL statement used to query a specified mysql date. Next I will summarize all the statements used to query mysql date.
Description: There is a member table, there is a birthday field, the value is 'yyyy-MM-
We will use update and delete to implement Association deletion and association update in mysql. The following is an example of mysql multi-Table Association update/deletion SQL statements, I hope this method will be helpful to you.
1. Use aliases
MySQL-Front is a mysql database management tool that can effectively manage mysql databases. Next I will introduce how to back up and restore MySQL databases using mysql-Front.
1. Back up the database
After the MySQL database is created, we need to
In general, we can choose to set mysql encoding during installation, but it is not as convenient as windows in liunx. Next I will introduce how to modify mysql encoding in liunx.
# Vi/etc/my. cnf
Open my. cnf and modify the encoding.
Vi/etc/my.
Performance Optimization in mysql databases has always been a hot topic. Next I will introduce how to avoid temporary tables and improve the performance of your SQL statements by 100 times.[Symptom]A slow query occurred in the online mysql database.
Generally, if we use the ID auto-incrementing primary key and delete the key, we cannot simply rank the ID again. Here are some operation tips.
The IDS of the auto-incrementing primary keys in Mysql database tables are messy and need to be
In mysql, null includes not null and if null or. I will introduce the precautions and usage of null in mysql. I hope it will be helpful to you.
Select null = 0, NULL = 12345, NULL <> 12345, NULL + 12345, NULL | 'abc', NULL = NULL, NULL <> NULL, null
When we use SQL statements to perform a query operation, we may find that the queried data results are sorted unordered. To better observe the query results in a data table, developers or users often need to sort the queried data, which requires the
1 Preface
Because the company's MySQL is built on the server, in order to avoid direct changes to the server, I chose to remotely Export and Import MySQL Data.
Let's take a look at it. Because the two tables alarmdata_h and mirror R under
The group by statement can deduplicate a column.Directly run the preceding statement: select io_dev_id from io_info where (TID = 1 AND host_name = 'yang1') group by 1; deduplication BY io_dev_id. P: The difference between order by and distinct is
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.