Difference between substring in Postgresql

久未见 提交于 2020-05-24 03:31:07

问题


I was checking the PostgreSQL Manual the last days and I have noticed that substring() is explained there with substring('string' FROM [int] FOR [int]).

I normally just use substring('string', [int], [int]) because I learned it that way from MySQL my simple question is now if this two have any differences is the first one maybe the better choice to use in PostgreSQL or does do the same and these are just 2 different kinds of doing the same thing?


回答1:


SUBSTRING(char_exp FROM start_position [FOR length]) syntax is part of SQL-92 standard and you are encouraged to use it.

This syntax also works in MySQL.



来源:https://stackoverflow.com/questions/48704934/difference-between-substring-in-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!