当前位置:网站首页>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
边栏推荐
猜你喜欢
stm32逆向入门
[notes of in-depth study paper]uctransnet: rethink the jumping connection in u-net from the perspective of transformer channel
Talk about seven ways to realize asynchronous programming
Flutter 3.0更新后如何应用到小程序开发中
C object storage
Go array and slice
搭建一个仪式感点满的网站,并内网穿透发布到公网 2/2
[深度学习论文笔记]UCTransNet:从transformer的通道角度重新思考U-Net中的跳跃连接
What about data leakage? " Watson k'7 moves to eliminate security threats
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging
随机推荐
网络安全-HSRP协议
Win10——轻量级小工具
The development of speech recognition app with uni app is simple and fast.
How to deal with the Yellow Icon during the installation of wampserver
TortoiseSVN使用情形、安装与使用
Datapipeline was selected into the 2022 digital intelligence atlas and database development report of China Academy of communications and communications
Log4j utilization correlation
Internal JSON-RPC error. {"code":-32000, "message": "execution reverted"} solve the error
Redis6 master-slave replication and clustering
Get you started with Apache pseudo static configuration
面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
zabbix 监控
Solve the problem of "unable to open source file" xx.h "in the custom header file on vs from the source
Backup and restore of Android local SQLite database
这18个网站能让你的页面背景炫酷起来
With 4 years of working experience, you can't tell five ways of communication between multithreads. Dare you believe it?
What happened to the communication industry in the first half of this year?
C object storage
Prefix, infix, suffix expression "recommended collection"
【Hot100】33. Search rotation sort array