When trying to sort based on values that do not fit the standard ascending and descending sort logic provide by your database engine you can use the following decode() function to sort based on custom value ordering.

By ordering your value list in a decode function you can sort based on the integer values you assign to each value.

SELECT X.FIELDVALUE, X.XLATLONGNAMEFROM PSXLATITEM XWHERE X.FIELDNAME = 'NOR_IMPRINT_TYPE' ORDER BYdecode( X.FIELDVALUE, 'S', 1, 'N', 2, 'O', 3 )
FIELDVALUE XLATLONGNAME
S Standard
N Optional
O Optional, additional charge

Custom Sort Order的更多相关文章

  1. [Javascript] Use a custom sort function on an Array in Javascript

    Sorting in Javascript with sort uses lexical sorting by default, which means it will sort in alphabe ...

  2. U3D sorting layer, sort order, order in layer, layer深入辨析

    1,layer是对游戏中所有物体的分类别划分,如UIlayer, waterlayer, 3DModelLayer, smallAssetsLayer, effectLayer等.将不同类的物体划分到 ...

  3. ECshop网点程序优化-后台添加类目自动选择上次父类目并计算Sort Order

    如果在ECshop后台批量添加过大量类目的人都能体会到是多么的不方便(这点还是要说一下ECshop的产品经理,细节上还是要多注意),每次添加都需要在几百个类目里面找到要添加的父类目也是一个麻烦事,比如 ...

  4. SORT ORDER BY STOPKEY

    select * from ( select * from ( select a.*,rownum rn from page a where object_id >1000 and owner= ...

  5. 791. Custom Sort String - LeetCode

    Question 791. Custom Sort String Solution 题目大意:给你字符的顺序,让你排序另一个字符串. 思路: 输入参数如下: S = "cba" T ...

  6. [LeetCode] Custom Sort String 自定义排序的字符串

    S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sort ...

  7. 791. Custom Sort String

    S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sort ...

  8. [Swift]LeetCode791. 自定义字符串排序 | Custom Sort String

    S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sort ...

  9. LeetCode 791. Custom Sort String

    题目链接:https://leetcode.com/problems/custom-sort-string/description/ S and T are strings composed of l ...

随机推荐

  1. [Flex] ButtonBar系列——flex3 ButtonBar各项之间的间距调整

    <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="h ...

  2. RDLC报表分页显示标题

    将报表以 XML的方式打开,搜索找到“详细信息” 在这个位置 <TablixRowHierarchy> <TablixMembers> <TablixMember> ...

  3. jQuery 中屏蔽浏览器的F5刷新功能

    //支持ie(6,7,8),火狐,谷歌,opera,等主流浏览器 $(document).keydown(function(e){ e=window.event||e; if(e.keyCode==1 ...

  4. types.MethodType

    http://stackoverflow.com/questions/972/adding-a-method-to-an-existing-object-instance 532down voteac ...

  5. 用浏览器打开本地html 直接到首页 的解决方法

    方法1:直接把本地文件拖到浏览器就可以打开

  6. 安装express后却找不到express的命令

    1.全局安装express npm install -g express 2.执行express命令,创建web项目框架 express -e ejs myweb 会提示 express 不是内部或外 ...

  7. T4 模板的调试方法,方便大家遇到问题自己快速定位和优化

    T4 模板的调试方法,方便大家遇到问题自己快速定位和优化 :1. .ttinclude文件的第一行修改为 <#@ template language="C#" debug=& ...

  8. CentOS内核编译

    From: http://blog.csdn.net/lchengcome/article/details/6715591From: http://bbs.chinaunix.net/thread-3 ...

  9. JAVA·多线程:线程优先级

    每次结果不尽相同,优先级不能完全保证! package multiThread; public class Thread04Priority { public static void main(Str ...

  10. Unity Shader : Ghost(残影) v1

    前阵子组长给我提了个需求,要实现角色人物的残影.我百度google了一下,发现可以用两种方式实现这个效果:1.记录前几帧的人物位置,将其传入shader中,对每个位置进行一个pass渲染.2. 通过相 ...