开发者

Array storage in SQLite

开发者 https://www.devze.com 2022-12-12 19:09 出处:网络
I need to store a set of scores in inte开发者_JAVA百科ger (array of scores) for a player. How can I store an array in a single column? I\'m using the SQLite database.Please don\'t store multiple value

I need to store a set of scores in inte开发者_JAVA百科ger (array of scores) for a player. How can I store an array in a single column? I'm using the SQLite database.


Please don't store multiple values in a single column, it makes for much harder queries. You're best to put in another table with a foreign key back to your first table.

   Table 1
    playerID
    playerName

   Table 2
    scoreID
    playerID
    score

Add multiple rows into table 2 and have the playerID in the second table reference playerID in the first table.

0

精彩评论

暂无评论...
验证码 换一张
取 消