What is the second argument in array_length() function?

不打扰是莪最后的温柔 提交于 2019-12-23 07:48:52

问题


Postgresql 9.4 has functions for array. One of them is array_length(anyarray, int). It get two argumetns.

What is the second argument? In all examples it has value 1. But nowhere says what it is.


回答1:


That's array's dimension.

Consider an example with a 2D array 3×2:

array_length(array[[1, 2], [3, 4], [5, 6]], 1) ---> 3
array_length(array[[1, 2], [3, 4], [5, 6]], 2) ---> 2

The size of the first dimension is 3; the size of the second dimension is 2.



来源:https://stackoverflow.com/questions/34356546/what-is-the-second-argument-in-array-length-function

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