当前位置:网站首页>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
边栏推荐
- The 2022 EdgeX China Challenge will be grandly opened on August 3
- C语言实现简单猜数字游戏
- Data storage practice based on left-order traversal
- word分栏小记
- 1873. 计算特殊奖金
- LeetCode uses the minimum cost to climb the stairs----dp problem
- Unleashing the engine of technological innovation, Intel joins hands with ecological partners to promote the vigorous development of smart retail
- post-study program
- How to solve the error cannot update secondary snapshot during a parallel operation when the PostgreSQL database uses navicat to open the table structure?
- 链表的简单描述及代码的简单实现
猜你喜欢

Beidou no. 3 short message terminal high slope in open-pit mine monitoring programme

View handler 踩坑记录

Regular expression to match a certain string in the middle

人人都在说的数据中台,你需要关注的核心特点是什么?

DAY22: sqli-labs shooting range clearance wp (Less01~~Less20)

剑指offer专项突击版第20天

正则表达式,匹配中间的某一段字符串

DAY23: Command Execution & Code Execution Vulnerability

RAID disk array

J9 Digital Currency: What is the creator economy of web3?
随机推荐
Solve connect: The requested address is not valid in its context
Physical backup issues caused by soft links
Syntax basics (variables, input and output, expressions and sequential statement completion)
[深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
1484. Sell Products by Date
[Decryption] Can the NFTs created by OpenSea for free appear in my wallet without being chained?
PostgreSQL数据库 用navicat 打开表结构的时候报错 cannot update secondarysnapshot during a parallel operation 怎么解决?
协作D2D局部模型聚合的半分散联合学习
Beidou no. 3 short message terminal high slope in open-pit mine monitoring programme
Images using redis cache Linux master-slave synchronization server hard drive full of moved to the new directory which points to be modified
tree table lookup
【解密】OpenSea免费创造的NFT都没上链竟能出现在我的钱包里?
Multithreading (2)
private package
C language implements a simple number guessing game
语法基础(变量、输入输出、表达式与顺序语句完成情况)
select 标签自定义样式
1667. 修复表中的名字
(11) Metaclass
甘特图来啦,项目管理神器,模板直接用