问题
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