当前位置:网站首页>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
边栏推荐
- Record in-depth learning - some bug handling
- Integer = = the comparison will unpack automatically. This variable cannot be assigned empty
- Aikesheng sqle audit tool successfully completed the evaluation of "SQL quality management platform grading ability" of the Academy of communications and communications
- Fragmented knowledge management tool memos
- Personal component - message prompt
- ZABBIX monitoring
- French scholars: the explicability of counter attack under optimal transmission theory
- [MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
- 那些考研后才知道的事
- Introduction to Chapter 8 proof problem of njupt "Xin'an numeral base"
猜你喜欢
What are the private addresses
Interviewer soul torture: why does the code specification require SQL statements not to have too many joins?
真正的缓存之王,Google Guava 只是弟弟
记录一下在深度学习-一些bug处理
“百度杯”CTF比赛 九月场,Web:Upload
Internal JSON-RPC error. {"code":-32000, "message": "execution reverted"} solve the error
“百度杯”CTF比赛 九月场,Web:SQL
[深度学习论文笔记]使用多模态MR成像分割脑肿瘤的HNF-Netv2
【公开课预告】:视频质量评价基础与实践
搭建一个仪式感点满的网站,并内网穿透发布到公网 2/2
随机推荐
Idea设置方法注释和类注释
[daily question] 1200 Minimum absolute difference
leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)
Jetpack Compose入门到精通
Redis6 master-slave replication and clustering
With 4 years of working experience, you can't tell five ways of communication between multithreads. Dare you believe it?
一文详解ASCII码,Unicode与utf-8
【MySQL 使用秘籍】一網打盡 MySQL 時間和日期類型與相關操作函數(三)
Flutter draws animation effects of wave movement, curves and line graphs
[MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
4年工作经验,多线程间的5种通信方式都说不出来,你敢信?
go map
Solve the problem of invalid uni app configuration page and tabbar
搭建一个仪式感点满的网站,并内网穿透发布到公网 2/2
【公开课预告】:视频质量评价基础与实践
Laravel framework operation error: no application encryption key has been specified
go map
The "Baidu Cup" CTF competition was held in February 2017, Web: explosion-2
53. Maximum subarray sum: give you an integer array num, please find a continuous subarray with the maximum sum (the subarray contains at least one element) and return its maximum sum.
Don't know these four caching modes, dare you say you understand caching?