Piotr Linski Piotr Linski - 4 years ago 117
MySQL Question

how to complete a mysql fiddle with a field that contains multiple values?

Please have a look at the following mysql fiddle ...

Now there is only inserted one last value, which is '18'.
Instead of inserting only '18' I would like to insert for example '3; 4; 9; 18'
so I would like that field to contain multiple values.

What changes do I need to make to the above MYSQL fiddle to get the scheme accepted for multiple values as well?

Answer Source

To store a list of semicolon separated values you have to change the field type of your last value to a type which supports string storage. For example you can use varchar, char or text.

See the updated fiddle for a possible solution.

Anyway, I don't no much about your use case but usually storing such a list is a sign of a bad data model.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download