One of my table column name 'applications' has values like '22,333,214,326', I would like to replace the 326 value with null space/blank .Required a function or query in MYSQL which should handle when the 326 is either in as first element /middle element/ last element in the list .(commas should also be taken care)
Asked
Active
Viewed 49 times
0
-
What have you already tried? – PM 77-1 Jun 25 '15 at 23:11
-
Consider regular expressions or substring function to find 326 as a substring of a column. – Ely Jun 25 '15 at 23:12
-
2If you have comma-separated values in your table, something's probably gone very, very wrong. – Strawberry Jun 25 '15 at 23:29
-
got that right berry – Drew Jun 25 '15 at 23:30
-
@Elyasin How would you use a regular expression, since MySQL doesn't have a regexp replace function? – Barmar Jun 26 '15 at 00:15
-
This is one of the many reasons why you shouldn't put comma-separated values in a database column. Normalize your schema. – Barmar Jun 26 '15 at 00:16
-
@Barmar http://stackoverflow.com/a/986870/1566187 – Ely Jun 26 '15 at 00:16
-
http://stackoverflow.com/questions/3653462/is-storing-a-delimited-list-in-a-database-column-really-that-bad – Barmar Jun 26 '15 at 00:20