pg中position、split_part、translate、strpos、length函数

select position('.' in '1.1.2.10');

select split_part('1.1.2.10','.',length('1.1.2.10') - length(translate('1.1.2.10','.',''))+1);

select split_part('1.1.2','.',length('1.1.2') - length(translate('1.1.2','.',''))+1);


select length(translate('1.1.2.10',’.’,’a’))+1 as num

select translate('1.1.2.10','.','')

select strpos('1.1.2.10','.')

select instr('1.1.2.10','.',1,3)

 

select length('1.1.2.10') - length(translate('1.1.2.10','.',''))

posted @ 2019-09-10 11:08  java奋斗  阅读(2924)  评论(0编辑  收藏  举报