Reputation: 155
I am inserting the cars using check boxes. i want to remove Audi car from the list . how can i achieve this one
+----+------------+-----------------+----------+---------+------------+----------+
| id | sms | Cars | usertype | noprice | regdate | time |
+----+------------+----------+----------+---------+------------+----------+------
| 82 | hello boys | BMW Audi Maruti | Driver | 50 | 2014-08-24 | 09:11:50 |
+----+------------+-----------------+----------+---------+------------+----------+
Expected result
+----+------------+------------+----------+---------+------------+----------+
| id | sms | Cars | usertype | noprice | regdate | time |
+----+------------+----------+----------+---------+------------+----------+--
| 82 | hello boys | BMW Maruti | Driver | 50 | 2014-08-24 | 09:11:50|
+----+------------+------------+----------+---------+------------+----------+
Upvotes: 1
Views: 22
Reputation: 64466
You can use replace()
function to update your column
update table set cars = replace(cars ,'Audi','') where id = 82
Or its better to relate cars with single user in a separate table with car name and associated user id ,each car and user relation in a separate row
Upvotes: 1