1. Use case when method (not recommended)-
The code is as follows
Copy Code
SELECTCOUNT (DISTINCT user_id) User_count,CaseWhen create_time>1395046800 and create_timeWhen create_time>1395050400 and create_timeWhen
See colleagues today's code, and learned a useful function, just look at the time do not understand, the search for the next use, see the following this article is very detailed on the direct reprint, I also write not so good, hehe, thank the author'
One, case, then ELSE END use usage.When you use SQL statements to count the occurrences of a certain state of a field, consider using the case and then ELSE END usage. When the amount of data is too large, it is not recommended.Example:SUM ( Case
MySQL Query results row field stitching, can be implemented with the following two functions:1. Concat functionMysql> Select Concat (' 1 ', ' 2 ', ' 3 ') from test; +---------------------+| Concat (' 1 ', ' 2 ', ' 3 ') |+---------------------+| 123 |
Optimization Items 1,Low_priority The delete operation occurs when the article table is not connected.Delete low_priority from T;Optimization Items 2,Quick when a row is deleted, the index is not deleted, and the index can be reused if it is
1. PhenomenaOn the command line, execute the SQL statement if it contains a question that says "Data too long for column name ' at row 1" or the result in the command line query, Chinese garbled 2. Analyze A. View the default encoding of the command
[1] When the database is deleted after the recovery methodFirst, create a test database.Mysql-u root-p123123← log in to MySQL server with root enter password:← Enter the root user password for MySQLWelcome toThe MySQL Monitor. CommandsEnd with
Default MySQL Monitor template installation method:Vim/usr/local/etc/zabbix_agentd.confUserparameter=mysql.ping,mysqladmin Ping | Grep-c AliveUserparameter=mysql.version,mysql-vUserparameter=mysql.status[*],echo "show global status where
IntroductionMy machine is win8.1, on the official website to download this installation is 32-bit and 64-bit can be installed, installation procedure reference: http://jingyan.baidu.com/article/67662997305dcd54d51b84d4.htmlPost-Installation
Yesterday, the desktop when the desktop to move a bunch of files to the F-disk, the result of some of the original project names appear red exclamation marks, open a look, it was because I put hibernate of those jar package removed, resulting in
Note 1,Bit (length), the maximum length of this data type is only 64, which meansBit (2) toBit (64) toBit (65) wrongBit (100) wrongNote 2, serialSerial is an alias of bigint UNSIGNED not NULL auto_increment unique.Note 3,tinyint (length) can only
Ubuntu installation MySQL appears fatal error:could not find mysqld processingError message:
#./bin/mysql_install_db–user=mysql
FATAL ERROR: Could not find mysqld
The following directories were searched:
Compile the required software addresshttp://mysql.mirror.kangaroot.net/Downloads/--Download the required MySQL version for example mysql-5.5.39.tar.gz don't quite understand MySQL so many of the installation package is to do, Mark a moment first.
Installing Mysql-5.5.28Since the data stored by MySQL is getting bigger and larger, I recommend storing the data on the LVM file system.1. Making LVM File systemThere is no longer a production process here, assuming we have done an LVM and mounted
Summary of MySQL Data Types and common field attributes, mysql DATA type fields
Preface
For example, in C ++, how many bytes are required to define the int type and how many bytes are required to define the double type. MySQL strictly controls the
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