Custom Sort Order

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
上一篇:android Json解析详解(详细代码)


下一篇:项目开发笔记-传单下发 名片替换 文件复制上传/html静态内容替换/json解析/html解析