mysql - Create new records from a field with comma delimited values -


i have poorly created table want update. set as

  • id
  • name
  • value

because given name can have more 1 value right value field varchar , populated comma delimited values:

  • 12,15,92

i create update or create table query make separate records table with

  • id | name | value
  • 1 | bob | 5,6,9
  • 2 | alice| 5,9
  • 3 | ted | 1

ends as

  • 1 | bob | 5
  • 2 | bob | 6
  • 3 | bob | 9
  • 4 | alice | 5
  • 5 | alice | 9
  • 6 | ted | 1

in searching online appear pretty common issue , found 1 of several functions splitting delimited fields records here:

http://kedar.nitty-witty.com/blog/mysql-stored-procedure-split-delimited-string-into-rows


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -