-4

Below is my SQL table

| ID |   Value   |
| 1  | A1 A2 A3  |

I would like to delete the A3 in the column: Value. Is there any method to do this?

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
arae
  • 9
  • 4
  • You can use SQL Update: `UPDATE table SET Value = 'A1 A2' Where Id = 1` – zolty13 Feb 22 '21 at 12:47
  • Yes three of the value are in one database record – arae Feb 22 '21 at 12:49
  • 2
    It boils down to simple string manipulation. Select the value, remove `A3` from the string and store it back. But, overall, you should reconsider your database design. [Storing multiple values in one column is a bad idea](https://stackoverflow.com/questions/3653462/is-storing-a-delimited-list-in-a-database-column-really-that-bad). – El_Vanja Feb 22 '21 at 12:49
  • Ok, Thank You for giving the solution – arae Feb 22 '21 at 12:54

1 Answers1

1

There's no way to edit/remove part of string, you just need to update whole cell. It's up tou you, how you'll prepare update data in your code.

SQL:

update tablename set Value = 'A1 A2' where ID=1

biesior
  • 55,576
  • 10
  • 125
  • 182