This article mainly brings you an article on how to use the concat function of mysql function splicing query. 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, I hope it can help everyone.
is as follows:
##
//查询表managefee_managefee的年year 和 month ,用concat函数拼成year-month。例如将2017和1 拼成2017-01。. select CONCAT(a.year,'-',if(a.month<=9,CONCAT('0',a.month),a.month))as date,a.* from managefee_managefee as a; //查询managefee_managefee中时间段为2017-01到2017-07的数据 select * from ( select CONCAT(a.year,'-',if(a.month<=9,CONCAT('0',a.month),a.month))as date,a.* from managefee_managefee as a ) b where b.date between '2017-01' and '2017-07';Related recommendations:
JavaScript method concat() to connect two or more arrays
Detailed examples of using the group_concat() function in MySQL
In-depth understanding of the concat method in javascript
The above is the detailed content of Detailed explanation of how to use the concat function of mysql function splicing query. For more information, please follow other related articles on the PHP Chinese website!