s1ddok
s1ddok

Reputation: 4654

Organize 3d array equivivalent in sql table

In my C# program I am parsing a website and I want to count the most frequent sequences of two or three elements.

Lets say I have 10 variants.

It can be 1-2-2, 4-5-1 etc. 1-3-4 == 3-1-4

Right now I'm thinking about array of int ([,,]), but I want to store and analyse information, so I decided to create a PostgreSQL DB.

Now I'm thinking about the best and easiest way to organize a 3d array equivalent via a sql table, can you suggest me something?

Upvotes: 0

Views: 741

Answers (1)

Marty
Marty

Reputation: 2016

A table with four columns can be used to hold the same data a 3D array can hold. The first three columns can be the array indices (say x,y and z), and the fourth column can hold the data value; Data[x,y,z].

Upvotes: 1

Related Questions