I
I
iddddy2019-10-07 20:52:26
SQL
iddddy, 2019-10-07 20:52:26

How to replace data in a table?

There is a video table, it has a channel column, which can look like 0|10|0 or 0|10|17|0 or 0|10|17|15|0.
How to replace data, you need to leave the first value after 0|, delete the rest, that is, in this example, only 10 should remain.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-10-07
@Compolomus

update video set channel = TRIM(BOTH '0|' FROM SUBSTRING_INDEX(`channel`, '|', 2))

It seems to work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question