0

I already read the mysql wiki but didn't get an answer how to delete specific entries from all rows in a column.

Let's say there's a column Example. In Example the .php wrote: "One, Two, Three, Four, Five, Six" And you want to delete Two and Six in all rows of the column. I don't get it how to delete those entries without having multiple commas. (Multiple commas = "One,, Three")

Thanks in Advance

Shadow
  • 33,525
  • 10
  • 51
  • 64
  • 2
    what have you tried so far? Share us the SQL query – Noob Sep 03 '17 at 22:15
  • I already tried: DELETE FROM database2 WHERE column3 = 'Six'; - That deletes the whole row – N. Falter Sep 03 '17 at 22:27
  • 2
    Comma separated values should not be in your database, it violates the [Zero, One or Infinity Rule](http://en.wikipedia.org/wiki/Zero_one_infinity_rule) of [database normalization](http://en.wikipedia.org/wiki/Database_normalization). This operation would be trivial if you have proper relational data, a one-to-many relationship in this case, as you could just delete the row you don't want. – tadman Sep 03 '17 at 23:32
  • 1
    Also keep in mind it's `DELETE FROM table_name`, not database. Deleting from the database makes no sense without a table for context. – tadman Sep 03 '17 at 23:32

0 Answers0