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. dirname basename 截取路径中的目录以及文件名

    dirname basename    截取路径中的目录以及文件名 windows 下面: #include "shlwapi.h"#pragma comment(lib, &qu ...

  2. Javascript 原型编程初探

    创建两个对象独立运行 var PlayTrace = function (interVal,name) { this.interVal = interVal; this.playName = name ...

  3. (medium)LeetCode 227.Basic Calculator II

    Implement a basic calculator to evaluate a simple expression string. The expression string contains ...

  4. Spring Data Jpa 规范接口表

      Keyword Sample JPQL snippet And findByLastnameAndFirstname … where x.lastname = ?1 and x.firstname ...

  5. MySQL数据库优化技术之数据库表的设计

    三范式介绍表的范式:只有符合的第一范式,才能满足第二范式,进一步才能满足第三范式. 1. 第一范式:表的列具有原子性,不可再分解.只要是关系型数据库都自动满足第一范式.数据库的分类:关系型数据库:My ...

  6. 海外支付:抵御信用卡欺诈的CyberSource

    海外支付:抵御信用卡欺诈的CyberSource 吴剑 2014-06-04 原创文章,转载必需注明出处:http://www.cnblogs.com/wu-jian 吴剑 http://www.cn ...

  7. Windows Phone 版 Cocos2d-x 程序的结构

    我们已经创建了一个 MyGame 的初始应用,这个应用的结构是什么样的呢? 一.应用程序入口 在 cpp-tests 中,app.xaml.cs 是标准的应用程序入口.与普通的 Windows Pho ...

  8. Indian Scientists Design Device to Collect Solar Energy 印度科学家设计太阳能收集设备

      Indian scientists have designed a new device they hope will solve one of the biggest problems with ...

  9. 全局变量 urllib模块 json模块

    1.vars()  查看一个.py文件中的全局变量 print(vars()) #重点 __name__': '__main__ '__file__': 'C:/Users/lenovo/Pychar ...

  10. 无法定位程序输入点ucrtbase.

    转:http://tieba.baidu.com/p/3848709732 后的解决方法是需要安装VC 2015 Redistributable,请自己选择相应的版本.百度云盘共享地址:http:// ...