The article shares the solution to mysql database Chinese garbled Characters During website development. If you encounter the same problem, refer to the following.
The character set of the database may cause garbled characters, which consumes a lot
This article introduces a very practical function replace in SQL. This function can replace the character you specified. The following describes how to use the update statement.
Mysql replace string function can replace some strings of a field with
The total value of an expression returned by the SUM function. This function is also very useful. Let's take a look at the detailed usage of this function.
The syntax of the SUM function is:
The Code is as follows:
Copy code
This is a simple article that uses SQL statements to copy data from one table to another. If you need it, refer to it.
Reputation: a and B are both tables -- B tables exist (the two tables have the same structure)
Insert into B select * from a if
This error occurs because mysql has never been able to support the problem. Unfortunately, it does not specify which problem will lead to the above error, below I listed the common causes of this terrible 150 error, and sorted by the possibility
Today, I wrote a group buying website trainer who used the S2SH big integration. It was a bit exciting, but there were a lot of troubles. After all, what I did for the first time? This log is about a big acquaintance, incorrect string value:
The code to randomly generate a string is as follows:
Define a random string method in the mysql tutorial, and then call this method in the SQL statement.
Method for defining random string functions:Select round (rand (), 4) * 10000 );You can simply
Select statements are used to select data from a table.
Results are stored in a result table (called a result set ).
SQL select syntaxSelect column name from Table Name and:
Select * from table name Note: SQL statements are case-insensitive. Select
Mysql tutorial common command set
Create database name; create database tutorial
Use databasename; select database
Drop database name directly deletes the database, no reminder
Show tables; displays tables
Describe tablename; Detailed
Mysql tutorial storage process creation and precautionsFirst, the mysql stored procedure is a little different from the stored procedure previously written in sqlserver 2005;
Second, I realized that when I used the mysql third-party Enterprise
Here is the real starting point. First, let's look at the data in the table */
Mysql tutorial> select count (*) from cdb_invites;
+ ---------- +
| Count (*) |
+ ---------- +
| 1, 261 |
+ ---------- +
1 row in set (0.00 sec)Copy
CodePS tutorial, the
This tutorial describes how to query and delete the mysql view. You can use the show view name to query the view and delete the mysql view with the drop permission. However, you must have the drop permission to delete the view. Next let's take a
For large tables in the database, statistical queries are usually slow, and you need to consider whether the query will affect online applications, in this case, we can use an intermediate table to increase the query statistics speed. Next we will
The WHERE clause specifies the criteria for selection.WHERE clause
To SELECT data from a table with conditions, you can add the WHERE clause to the SELECT statement.Syntax
SELECT column name FROM table name WHERE column operator Value
The following
Mysql + php database operations
Class DbQueryForMysql {/*** Maximum number of records returned by the select Method*/Const max_row_num= 1000;
/*** Data Query Result set object* @ Var object $ dataSet*/Public $ dataSet = NULL;
/*** Data source object*
SQL deletes duplicate dataThis article provides a mysql statement for deleting duplicate data, that is, there are more than two duplicate data records in the data table, and the information with the smallest number is deleted.Delete 'borough _ name'
User table:Id | name---1 | libk2 | zyfon3 | daodaoUser_action table:User_id | action-----1 | jump1 | kick1 | jump2 | run4 | swimSQL:Select id, name, action from user as uLeft join user_action a on u. id = a. user_idResult:Id | name | action----------
How to optimize the mysql database
If you create a large number of tables in a database, you can execute the Open and Close operations to create tables. 2: mysql uses the memory. A: The keyword cache zone (key_buffer_size) is shared by all threads.
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