以下是我要尝试实现的示例(从不介意选择查询,因为它只是为了显示我的实际问题)
例如,
select col1 from(
select 'tab09' as col1
union
select 'tab09_01'
union
select 'tab09_02'
union
select 'tab09_03'
union
select 'tab09_04'
) t order by col1
将返回
col1
----------
tab09
tab09_01
tab09_02
tab09_03
tab09_04
那么,哪个PostgreSQL
函数将有助于获得如下结果
col1 col2
----------+----------
tab09 tab10
tab09_01 tab10_01
tab09_02 tab10_02
tab09_03 tab10_03
tab09_04 tab10_04
答案 0 :(得分:1)
select col1,overlay(col1 placing '10' from 4 for 2) col2 from(
--your select query goes here
) t order by col1
答案 1 :(得分:0)