mysql - Select 1 row multiple time if has more then 1 value in other column -
i have database structure. issue table complex (typo3).
i simplify this:
| id |cat | |==========|=====| |1 |44,15| |2 |16 | |3 |29,30| what want have result 1 row each category (cat), mean
1 44 1 15 2 16 3 29 3 30 i tried use simple select of course not work.
i tried use left join table category using category.id in (table1.cat)
1.: db structure bad! not first normal form (1nf), because have array in column string representation.
2.: it's not tricky.
some inspiration: http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/ or here: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_substring-index
Comments
Post a Comment