Postgresql 字符串转整型数值之后进行排序

1、字符串转Integer

SELECT CAST (title as integer)

  FROM xxx where code='-1';

2、字符串转整型之后排序

ordey by cast(unit as integer)

原文地址:https://www.cnblogs.com/dancser/p/13633735.html