当前位置:网站首页>mysql函数
mysql函数
2022-07-02 18:27:00 【ekkcole】
拼接函数:concat(str,‘拼接的字符’)
保留左边数据:LEFT(str,0)
保留右边数据:RIGHT(str,0)
判空函数并赋值:IFNULL(str,‘自定义’)
拼接函数:CONCAT_WS(str,str,…)
分组后拼接函数:GROUP_CONCAT(str,str…)
SELECT
concat(LEFT(t2.task_time,4),'年') year,
RIGHT(t2.task_time,5) date,
IFNULL(GROUP_CONCAT( concat( t3.custom_inputs_name, '(', t3.num, t3.unit_name, ')' ) ),'暂无记录') detail,
CONCAT_WS(',',t2.image1,t2.image2,t2.image3) images
FROM
tb_farming_plot t1
LEFT JOIN tb_farming_manage t2 ON t2.record_id = t1.record_id
LEFT JOIN tb_farming_manage_detail t3 ON t3.manage_id = t2.id
GROUP BY
t2.id
HAVING
count( t2.id )>= 1
ORDER BY t2.task_time desc
结果
边栏推荐
- 2022.7.1-----leetcode. two hundred and forty-one
- MySQL高级(进阶)SQL语句
- Golang并发编程——goroutine、channel、sync
- 以太网PHY层芯片LAN8720A简介
- 冒泡排序数组
- 函数高阶-柯里化实现
- Gstore weekly gstore source code analysis (4): black and white list configuration analysis of security mechanism
- Golang concurrent programming goroutine, channel, sync
- Watchful pioneer world outlook Architecture - (how does a good game come from)
- Gmapping code analysis [easy to understand]
猜你喜欢

Why should we build an enterprise fixed asset management system and how can enterprises strengthen fixed asset management

In pytorch function__ call__ And forward functions

Excel finds the same value in a column, deletes the row or replaces it with a blank value

教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5

How performance testing creates business value

xml开发方式下AutowiredAnnotationBeanPostProcessor的注册时机

注解开发方式下AutowiredAnnotationBeanPostProcessor的注册时机

数据降维——主成分分析

Introduction to the paper | application of machine learning in database cardinality estimation

性能测试如何创造业务价值
随机推荐
Preprocessing and preprocessing macros
Thread application instance
C的内存管理
股票证券公司排名,有安全保障吗
MySQL高级(进阶)SQL语句
多态的理解以及作用
QT中的QPropertyAnimation使用和toast案列
Yunna | why use the fixed asset management system and how to enable it
MySQL advanced (Advanced) SQL statement
Page title component
What is 9D movie like? (+ common sense of dimension space)
虚拟机初始化脚本, 虚拟机相互免秘钥
仿京东放大镜效果(pink老师版)
#gStore-weekly | gStore源码解析(四):安全机制之黑白名单配置解析
以太网PHY层芯片LAN8720A简介
Golang:[]byte to string
The mybatieshelperpro tool can be generated to the corresponding project folder if necessary
Emmet基础语法
Data dimensionality reduction factor analysis
新手必看,点击两个按钮切换至不同的内容