snippetsqlMinor
How to store an array in a table column?
Viewed 0 times
columnarraystorehowtable
Problem
I have multiple contacts for a user and I want to store them in a single column.
How can I do that?
uID | Contact
----| ---------
2 | 1221
| 1223
----|----------
3 | 1123How can I do that?
Solution
You can create separate tables, like user table and contact table:
-
user table
-
contact table
-
user table
uID
---
2-
contact table
Contact | uID
1221 | 2
1223 | 2Code Snippets
Contact | uID
1221 | 2
1223 | 2Context
StackExchange Database Administrators Q#191954, answer score: 4
Revisions (0)
No revisions yet.