0

In SQLite , How would you store the information like this:

id       name         groups
1        xyz          one,two
2        abc          one
3        lmn          two,three

The groups column may multiple entries. How can we store like that? The main thing is the multiple values are should be appended.

1
  • Maybe store them as a JSON array. Commented Jul 11, 2018 at 8:47

1 Answer 1

1

I'm not sure I understand it correctly but why not store it as delimited string? Something like string1;string2;string3..or use comma instead of semi-colon like you already posted.

Just fetch the row, append the data followed by your delimiter and update the record. When you need the individual entries, just split the string using your delimiter.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.