Postgresql中子字符串之间的区别 [英] Difference between substring in Postgresql

查看:86
本文介绍了Postgresql中子字符串之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近几天,我在查看PostgreSQL手册,并且注意到 substring() substring('string'FROM [int] FOR [int]进行解释)

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]).

我通常只使用 substring('string',[int],[int])因为我是从MySQL那里学到的,所以我的简单问题是,现在这两个是否有任何不同,第一个也许是在PostgreSQL中使用的更好选择,或者确实这样做,但这只是两种不同的方法

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?

推荐答案

SUBSTRING(char_exp FROM start_position [FOR length])语法是 SQL-92标准的一部分,并且鼓励您使用它。

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

此语法在MySQL中也可以使用

这篇关于Postgresql中子字符串之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆