简体   繁体   中英

Is it possible to declare an array data type column? SQL

CREATE TABLE user (
...
columnName int ARRAY[7][7] DEFAULT null,
...
)

I have to create a table where one of the columns has to store a 7x7 array, but i can't figure it out!

Is it even possible in SQL?

-- UPDATE So, I've decided I am going to cheat it and store it as a TEXT and then with code I'll work with that string

SQL 2003 (and to a lesser extent SQL 99) provide array types, see for instance here: http://farrago.sourceforge.net/design/CollectionTypes.html I've used them extensively with PostgreSQL to simplify my designs. For clients that don't support array semantics yet, it's possible to provide views which "unnest" the arrays.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM