当前位置:网站首页>MySQL if else use case use
MySQL if else use case use
2022-07-05 13:43:00 【Php_ XiaoZhi】
SELECT
b.id AS " Device owners id",
b. NAME AS " Name of device owner ",
CONCAT(b.tel, '\t') AS " Device owner's phone ", -- export csv Set to normal text Id card 、 cell-phone number 、 Digital order number, etc
CONCAT(a.cdkey, '\t') AS " equipment sn code ",
IF (a.fromId = 0, " company ", c. NAME) AS " Name of transferor ", -- If 0 Show company , Other display query names
IF (a.fromId = 0," company ",CONCAT(c.tel, '\t')) AS " Dispatcher's telephone ",
( case when a.type = 1 then " purchase "
when a.type = 2 then " exchange "
when a.type = 3 then " Activate "
end) AS " operation ", -- Multi condition judgment
FROM_UNIXTIME(a.created_at, '%Y-%m-%d %H:%i:%s') AS " Recording time " -- Timestamp conversion time format
FROM
db_user_pos_record_detail AS a,
db_user AS b,
db_user AS c
WHERE
cdkey = '123456'
AND b.id = a.toId
AND c.id = b.pid
边栏推荐
- Network security HSRP protocol
- How to apply the updated fluent 3.0 to applet development
- Idea set method annotation and class annotation
- [notes of in-depth study paper]transbtsv2: wider instead of deep transformer for medical image segmentation
- Integer ==比较会自动拆箱 该变量不能赋值为空
- Shandong University Summer Training - 20220620
- Resttemplate details
- Jenkins installation
- Operational research 68 | the latest impact factors in 2022 were officially released. Changes in journals in the field of rapid care
- 【公开课预告】:视频质量评价基础与实践
猜你喜欢
[daily question] 1200 Minimum absolute difference
jenkins安装
Interviewer soul torture: why does the code specification require SQL statements not to have too many joins?
These 18 websites can make your page background cool
RK3566添加LED
Jenkins installation
[深度学习论文笔记]使用多模态MR成像分割脑肿瘤的HNF-Netv2
Redis6 master-slave replication and clustering
About the problem and solution of 403 error in wampserver
南理工在线交流群
随机推荐
Talk about seven ways to realize asynchronous programming
网络安全-HSRP协议
【Hot100】34. Find the first and last positions of elements in a sorted array
Summit review | baowanda - an integrated data security protection system driven by compliance and security
运筹说 第68期|2022年最新影响因子正式发布 快看管科领域期刊的变化
Primary code audit [no dolls (modification)] assessment
What is a network port
Network security HSRP protocol
Don't know these four caching modes, dare you say you understand caching?
华为推送服务内容,阅读笔记
Internal JSON-RPC error. {"code":-32000, "message": "execution reverted"} solve the error
Jetpack Compose入门到精通
Aikesheng sqle audit tool successfully completed the evaluation of "SQL quality management platform grading ability" of the Academy of communications and communications
Log4j utilization correlation
When using Tencent cloud for the first time, you can only use webshell connection instead of SSH connection.
Resttemplate details
C object storage
南理工在线交流群
Shandong University Summer Training - 20220620
Redis6 master-slave replication and clustering