当前位置:网站首页>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
边栏推荐
- 一网打尽异步神器CompletableFuture
- Log4j utilization correlation
- Clock cycle
- asp. Net read TXT file
- 这18个网站能让你的页面背景炫酷起来
- Go array and slice
- 研究生可以不用学英语?只要考研英语或六级分数高!
- Laravel framework operation error: no application encryption key has been specified
- Rocky basic command 3
- Laravel框架运行报错:No application encryption key has been specified
猜你喜欢
These 18 websites can make your page background cool
Scientific running robot pancakeswap clip robot latest detailed tutorial
What about data leakage? " Watson k'7 moves to eliminate security threats
Primary code audit [no dolls (modification)] assessment
Laravel framework operation error: no application encryption key has been specified
Backup and restore of Android local SQLite database
[深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation
记录一下在深度学习-一些bug处理
MySQL - database query - sort query, paging query
Nantong online communication group
随机推荐
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging
go 指针
[daily question] 1200 Minimum absolute difference
Integer = = the comparison will unpack automatically. This variable cannot be assigned empty
What about data leakage? " Watson k'7 moves to eliminate security threats
Introduction to Chapter 8 proof problem of njupt "Xin'an numeral base"
Rocky basic command 3
Wonderful express | Tencent cloud database June issue
NFT value and white paper acquisition
French scholars: the explicability of counter attack under optimal transmission theory
ELK 企业级日志分析系统
When using Tencent cloud for the first time, you can only use webshell connection instead of SSH connection.
A detailed explanation of ASCII code, Unicode and UTF-8
MATLAB论文图表标准格式输出(干货)
"Baidu Cup" CTF competition in September, web:upload
个人组件 - 消息提示
About the problem and solution of 403 error in wampserver
Record in-depth learning - some bug handling
Godson 2nd generation burn PMON and reload system
Scientific running robot pancakeswap clip robot latest detailed tutorial