I have a MySQL 5.5 table with a column containing a SET datatype. Each entry has between 0 to 4 values for the SET column. I would like to write a SELECT statement that will return a separate row for each value in the SET. Is this possible with a single statement?
Thanks in advance, Peter
EDIT
Edited to include an example:
The table structure is very basic:
- INT(6) UNSIGNED PRIMARY KEY (id)
- VARCHAR(20) UNIQUE INDEX (material)
- SET('Solid','Liquid','Gas','Plasma') (states)
In the example above you can imagine having a table populated with various materials (material) and the SET column for each includes all of the states (states) that that material can exist in. I'd like to see the statement return a seperate row for each SET value that a material has, duplicating the id and material name.
Hope that helps clarify things.