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. C++学习29 重载[](下标运算符)

    前面已经提到,下标操作符[]必须以类的成员函数的形式进行重载.在类中的声明格式如下: 返回值类型 & operator[] (参数) 或 const 返回值类型 & operator[ ...

  2. [ActionScript 3.0] Away3D 天空盒(skybox)例子

    /* SkyBox example in Away3d Demonstrates: How to use a CubeTexture to create a SkyBox object. How to ...

  3. SQL查询包含汉字的行

    1.查询字段首位为汉字 2.查询字段包含汉字(任意位) SELECT * FROM 表名 WHERE 字段 LIKE '%[吖-座]%' --[吖-座]是中文字符集第一个到最后一个的范围

  4. (easy)LeetCode 258.Add Digits

    Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. ...

  5. Java String 的实例(02)

    1.初始化数组以及数组的拷贝 int[] a={1,2,3,4};        //System.out.println(Arrays.toString(a));        a=new int[ ...

  6. sqlite支持的数据库类型

    http://www.sqlite.org/datatype3.html 默认只支持:NULL,INTEGER,REAL,TEXT,BLOB

  7. java环境变量完整版

    jdk默认安装 Key: JAVA_HOME(新建) Value: C:\Program Files\Java\jdk1.8.0_25 Key: Path(编辑) Value: %JAVA_HOME% ...

  8. css 使用background背景实现border边框效果

    css中,我们一般使用border给html元素设置边框,但也可以使用background背景来模拟css边框效果,本文章向大家介绍css 使用background背景实现border边框效果,需要的 ...

  9. YUV主要采样格式理解

    主要的采样格式有YCbCr 4:2:0.YCbCr 4:2:2.YCbCr 4:1:1和 YCbCr 4:4:4.其中YCbCr 4:1:1 比较常用,其含义为:每个点保存一个 8bit 的亮度值(也 ...

  10. 搭建基于Windows + Apache + PHP + MySQL的Moodle平台

    说起Moodle,我相信学习教育技术的同学应该都不陌生,在大学的网络与远程教育课中,我有幸与传说中的Moodle相遇,然后相知,但是我绝对不会跟你们说一直到我毕业,我都没有找到一个合适的时间与这位Ms ...