A friend asked me a call back question, which probably means: in the deal table, you only need to query the record of top-up of all the mobile phone users who recharge the account more than two times a day and the total amount exceeds 50.
Let's
Select * from account where userName like 'ad % ';
Select * from account where userName> = 'ad' and userName
/*
The results of these two queries are the same, and the efficiency seems to be similar. No specific efficiency test is conducted.
Learning set statements:
Use select to define user Variables
Change the following statement to select:
Set @ VAR = (select sum (amount) from penalties );
My modifications:
Select @ VAR: = (select sum (amount) from penalties );
I can change it
4. Notes
MySQL stored procedures can be annotated using two styles
Dual-mode bar: // This style is generally used for single-line comment
C style:/* Comment content */generally used for multi-line comment
5. query MySQL stored procedures
As we
This refers to the size of the form, rather than the maximum length of a data storage item in the table.
PS the length of the blob type in the table is given here. BLOB is a binary large object. It is a container that can store large amounts of
I encountered a problem about the difference between on and where in left join at work today. I don't know if I can use where in left join. I asked my colleagues to know! This record is used for future query.
Difference: Condition Association in
There is a crm system, where a report is made, where the source code and database are placed on the same server, and the database uses mysql. However, on the suddenly reported error page today, the system prompts that the connection cannot be
First, I got the SQL file without garbled characters (the file encoding can be seen on the ultraedit administrator interface)
Database encoding and file consistency
Next we will go to mysql to see variables.
Www.2cto.com
Mysql> show variables
Data Import and Export (Export/Import) are often used when phpMyAdmin is used. However, when importing big data, the php file upload and script response time are limited, as a result, phpMyAdmin cannot import big data. For importing big data to
1. Command LinePreface:To know the space occupied by a table, it is equivalent to the data size + index size.Show databases; (view the number of databases, also known as table schema; it is a bit of a string) 1.1 view the size occupied by a single
Content:*************1After installing MYSQL, change the ROOT password and useNet startmysqlI encountered this problem at startup.C: \ mysql \ bin \ mysqladmin-u root-p shutdownNet start mysql does not have this error prompt!*************2MySQL
When I learned MYSQL, I took the user table in mysql and found some problems with mysql subqueries. For example, the contents of the user table are as follows: Shows how to change it:
It should be very simple, but it should be OK with the subquery,
When a data table contains a large amount of data, you only need to check the values of some of the fields, instead of all the data, you only need to check a few rows. At this time, you can use limit
For example:
1. select * from tags limit 4; it is
The requirements are as follows: I have a table with the basic data, and a field is the management number. My goal is to first query the latest management number, generate a new management number according to the rules, and then insert the new data
Install MySQL in Ubuntu10.10. terminal installation (1) the terminal executes the command: sudo apt-get install mysql-server mysql-client (2) Check the installation result sudo netstat-tap | grep mysql when you run this command, you can see a line
This problem has been entangled for a long time. The cause is recorded: MySQL5.0 Bug. You need to include the joined table in parentheses: SQL code SELECT (c. id,. id, B. id) from a a, B B LEFT JOIN C c ON c. a_id =. a_id AND c. B _id = B. the
MySQL inserts a record when the record does not exist. When the record exists, there are three solutions to update the online. Example 1: INSERT multiple records. Suppose There Is A client_id table with the primary key. You can use the following
Today, the external keywords are used for writing database scripts. Two types of errors are encountered during the runtime: 121 and 150. I found a solution on Google. They are explained as follows:Error 121: this is an error where the names of
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