当前位置:网站首页>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
结果
边栏推荐
- Gmapping code analysis [easy to understand]
- 数据降维——因子分析
- When converting from list to map, if a certain attribute may cause key duplication and exceptions, you can set the way to deal with this duplication
- mysql备份后缀是什么_mysql备份还原
- Talk about the design of red envelope activities in e-commerce system
- 4274. 后缀表达式-二叉表达式树
- 2022 compilation principle final examination recall Edition
- [paper reading] Ca net: leveraging contextual features for lung cancer prediction
- Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises
- NPOI导出Excel2007
猜你喜欢

Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3

Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5

Introduction to the paper | application of machine learning in database cardinality estimation
Bubble sort array
冒泡排序数组

Juypter notebook modify the default open folder and default browser

教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5

zabbix5客户端安装和配置

What is 9D movie like? (+ common sense of dimension space)

开发固定资产管理系统,开发固定资产管理系统用什么语音
随机推荐
二进制操作
450-深信服面经1
安装单机redis详细教程
SIFT特征点提取「建议收藏」
codeforces每日5题(均1700)-第四天
How performance testing creates business value
【测试开发】一文带你了解什么是软件测试
Progress progress bar
C file input operation
电脑使用哪个录制视频软件比较好
Memory management of C
[test development] software testing - concept
Refactoring: improving the design of existing code (Part 1)
PHP非对称加密方法私钥及公钥加密解密的方法
metric_logger小解
High frequency interview questions
Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
When converting from list to map, if a certain attribute may cause key duplication and exceptions, you can set the way to deal with this duplication
《重构:改善既有代码的设计》读书笔记(上)
冒泡排序数组