当前位置:网站首页>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
结果
边栏推荐
- 新手必看,点击两个按钮切换至不同的内容
- [0701] [paper reading] allowing data imbalance issue with perforated input during influence
- Imitation Jingdong magnifying glass effect (pink teacher version)
- NPOI导出Excel2007
- mysql备份后缀是什么_mysql备份还原
- Golang concurrent programming goroutine, channel, sync
- 以太网PHY层芯片LAN8720A简介
- 2022.7.1-----leetcode.241
- Refactoring: improving the design of existing code (Part 1)
- Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
猜你喜欢

Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径

新手必看,点击两个按钮切换至不同的内容

Data dimensionality reduction factor analysis

Compile oglpg-9th-edition source code with clion

仿京东放大镜效果(pink老师版)

Yolov3 trains its own data set to generate train txt

Refactoring: improving the design of existing code (Part 1)

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

线程应用实例

Machine learning notes - time series prediction research: monthly sales of French champagne
随机推荐
Novice must see, click two buttons to switch to different content
Thread application instance
What is the MySQL backup suffix_ MySQL backup restore
Transformation of thinking consciousness is the key to the success or failure of digital transformation of construction enterprises
Gmapping code analysis [easy to understand]
Use cheat engine to modify money, life and stars in Kingdom rush
453-atoi函数的实现
数字滚动带动画
PHP非对称加密方法私钥及公钥加密解密的方法
MySQL表历史数据清理总结
中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
LeetCode 0871.最低加油次数 - 类似于POJ2431丛林探险
ORA-01455: converting column overflows integer datatype
教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5
新手必看,點擊兩個按鈕切換至不同的內容
The mybatieshelperpro tool can be generated to the corresponding project folder if necessary
[pytorch learning notes] tensor
According to the atlas of data security products and services issued by the China Academy of information technology, meichuang technology has achieved full coverage of four major sectors
二进制操作
Refactoring: improving the design of existing code (Part 1)