当前位置:网站首页>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
结果
边栏推荐
- Markdown基础语法
- Progress progress bar
- 以太网PHY层芯片LAN8720A简介
- Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
- 450-深信服面经1
- 《代码整洁之道》读书笔记
- Mobile robot path planning: artificial potential field method [easy to understand]
- Advanced performance test series "24. Execute SQL script through JDBC"
- 冒泡排序数组
- A4988 drive stepper motor "recommended collection"
猜你喜欢
What is 9D movie like? (+ common sense of dimension space)
搭建哨兵模式reids、redis从节点脱离哨兵集群
安装单机redis详细教程
注解开发方式下AutowiredAnnotationBeanPostProcessor的注册时机
Tutorial (5.0) 09 Restful API * fortiedr * Fortinet network security expert NSE 5
Processing strategy of message queue message loss and repeated message sending
【测试开发】软件测试—概念篇
Tutorial (5.0) 10 Troubleshooting * fortiedr * Fortinet network security expert NSE 5
线程应用实例
Introduction to the paper | application of machine learning in database cardinality estimation
随机推荐
新手必看,点击两个按钮切换至不同的内容
[paper reading] Ca net: leveraging contextual features for lung cancer prediction
Golang:[]byte to string
[test development] takes you to know what software testing is
为什么要做企业固定资产管理系统,企业如何加强固定资产管理
A4988驱动步进电机「建议收藏」
Golang concurrent programming goroutine, channel, sync
Yolov3 trains its own data set to generate train txt
Horizontal ultra vires and vertical ultra vires [easy to understand]
思考变量引起的巨大变化
2022.7.1-----leetcode.241
Gmapping code analysis [easy to understand]
What is 9D movie like? (+ common sense of dimension space)
[error record] problems related to the installation of the shuttle environment (follow-up error handling after executing the shuttle doctor command)
Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出
Emmet basic syntax
Emmet基础语法
[0701] [paper reading] allowing data imbalance issue with perforated input during influence
Use cheat engine to modify money, life and stars in Kingdom rush
IDEA编辑器去掉sql语句背景颜色SQL语句警告No data sources are configured to run this SQL...和SQL Dialect is Not Config