PG format的使用

  • 实例
imos=# SELECT     FORMAT('%s apple, %s orange, %s banana', 'small', 'big','small');
                format                 
---------------------------------------
 small apple, big orange, small banana
(1 row)

imos=# SELECT     FORMAT('%1$s apple, %2$s orange, %1$s banana', 'small', 'big');
                format                 
---------------------------------------
 small apple, big orange, small banana
(1 row)
posted @ 2019-10-08 21:50  岳麓丹枫  阅读(463)  评论(0编辑  收藏  举报