emulating MySQL's substring_index() in PGSQL

后端 未结 2 1820
离开以前
离开以前 2021-01-17 16:51

I would like to find an elegant way to emulate the behavior of MySQL\'s subtring_index() function in Postgres.

In MySQL, it\'s as easy as:

mysql>         


        
2条回答
  •  猫巷女王i
    2021-01-17 17:13

    Always take the time to skim the manuals.

    http://www.postgresql.org/docs/current/static/functions-string.html

    If split_part(string text, delimiter text, field int) doesn't do what you want (and more, if I understand your MySQL function) then you'll need to explain where and why.

提交回复
热议问题