当前位置:网站首页>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
结果
边栏推荐
猜你喜欢

高级性能测试系列《24. 通过jdbc执行sql脚本》

How performance testing creates business value

Quanzhi A33 uses mainline u-boot

PHP parser badminton reservation applet development requires online system

Codeworks 5 questions per day (1700 average) - day 4

守望先锋世界观架构 ——(一款好的游戏是怎么来的)

数据降维——因子分析

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

Imitation Jingdong magnifying glass effect (pink teacher version)

Thread application instance
随机推荐
Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
[pytorch learning notes] tensor
使用xml文件打印mybaties-log插件的方式
Qpropertyanimation use and toast case list in QT
4274. Suffix expression - binary expression tree
[test development] software testing - concept
仿京东放大镜效果(pink老师版)
LeetCode 0871.最低加油次数 - 类似于POJ2431丛林探险
In pytorch function__ call__ And forward functions
Obligatoire pour les débutants, cliquez sur deux boutons pour passer à un contenu différent
使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
冒泡排序数组
QT中的QPropertyAnimation使用和toast案列
Usage of ieda refactor
PHP asymmetric encryption method private key and public key encryption and decryption method
Golang并发编程——goroutine、channel、sync
PHP parser badminton reservation applet development requires online system
A4988 drive stepper motor "recommended collection"
SIFT feature point extraction "suggestions collection"
End-to-End Object Detection with Transformers(DETR)论文阅读与理解