PLPGSQL数组索引从1开始?

时间:2021-03-20 22:56:50

I have found that, by default, the first index of an array in PLPGSQL starts at 1, and not 0 like most programming languages. I was just curious as to why this is, and what other programming language follow this?

我发现,默认情况下,PLPGSQL中数组的第一个索引从1开始,而不是像大多数编程语言一样。我只是好奇为什么会这样,以及其他编程语言是如何遵循这一点的?

Thanks!

谢谢!

1 个解决方案

#1


9  

What languages follow the default array indexing at 1?

在1处使用默认数组索引的语言是什么?

ALGOL 68, COBOL, Fortran (if not specified otherwise), FoxPro, Lua, MATLAB, ... anyway, the list is here.

ALGOL 68,COBOL,Fortran(如果没有另外说明),FoxPro,Lua,MATLAB,......无论如何,列表就在这里。

#1


9  

What languages follow the default array indexing at 1?

在1处使用默认数组索引的语言是什么?

ALGOL 68, COBOL, Fortran (if not specified otherwise), FoxPro, Lua, MATLAB, ... anyway, the list is here.

ALGOL 68,COBOL,Fortran(如果没有另外说明),FoxPro,Lua,MATLAB,......无论如何,列表就在这里。