当前位置:网站首页>How to sort multiple fields and multiple values in sql statement
How to sort multiple fields and multiple values in sql statement
2022-08-05 02:47:00 【CSDN Q&A】
How to sort multiple fields and multiple values in SQL statement?The requirement is to query all the lists, and then sort them according to the origin and destination. I use the case when syntax to always report an error
sql statement as follows
select swco.id,swco.order_type,swco.goods_type_id,swco.departure,swco.bounty,swco.goods_number,swco.goods_name,swco.destination,swco.goods_value,swco.goods_weight,swco.order_status,swco.end_time,swco.start_time from sys_we_chat_order swco where swco.deleted =0 order by case when departure ='Beijing' and destination ='Hengshui' then 'Beijing' when departure ='Beijing' then 'Hengshui' when destination ='Hengshui' then 'Hengshui', swco.create_time desc
The error message is as follows
Is there anything wrong with this, or how to implement it in other ways
边栏推荐
- QT:神奇QVarient
- Syntax basics (variables, input and output, expressions and sequential statements)
- Matlab map with color representation module value size arrow
- mysql树状结构查询问题
- Study Notes-----Left-biased Tree
- 1527. 患某种疾病的患者
- Matlab drawing 3
- [In-depth study of 4G/5G/6G topic-51]: URLLC-16-"3GPP URLLC related protocols, specifications, and technical principles in-depth interpretation"-11-High reliability technology-2-Link adaptive enhancem
- 继承关系下构造方法的访问特点
- Chinese characters to Pinyin
猜你喜欢
线上MySQL的自增id用尽怎么办?
【LeetCode刷题】-数之和专题(待补充更多题目)
DAY23: Command Execution & Code Execution Vulnerability
Matlab drawing 3
VSCode Change Default Terminal how to modify the Default Terminal VSCode
C language implements a simple number guessing game
The design idea of DMicro, the Go microservice development framework
J9 Digital Currency: What is the creator economy of web3?
The 2022 EdgeX China Challenge will be grandly opened on August 3
DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
随机推荐
【OpenCV 图像处理2】:OpenCV 基础知识
undo问题
Pisanix v0.2.0 released | Added support for dynamic read-write separation
[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)
QT:神奇QVarient
ARM Mailbox
undo problem
1484. 按日期分组销售产品
lua learning
HDU 1114: Piggy-Bank ← The Complete Knapsack Problem
协作D2D局部模型聚合的半分散联合学习
Quickly learn chess from zero to one
DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
Study Notes-----Left-biased Tree
后期学习计划
leetcode - a subtree of another tree
Ant Sword Advanced Module Development
Solve the problem of port occupancy Port xxxx was already in use
使用二维码传输文件的小工具 - QFileTrans 1.2.0.1
Tencent Cloud [Hiflow] New Era Automation Tool