PostgreSQL/Array/array dims

Материал из SQL эксперт
Версия от 13:14, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Using array_dims()

   <source lang="sql">

postgres=# CREATE TABLE book (id integer,titles text[]); CREATE TABLE postgres=# postgres=# INSERT INTO book VALUES (102, "{"AAA\"s VVVV"}"); INSERT 0 1 postgres=# INSERT INTO book VALUES (103, "{"AAA", "VVVV"}"); INSERT 0 1 postgres=# postgres=# -- Using array_dims(?) postgres=# SELECT array_dims(titles) FROM book;

array_dims

[1:1]
[1:2]

(2 rows) postgres=# drop table book; DROP TABLE postgres=#

      </source>