V
V
Vladislav2016-01-11 15:43:00
MySQL
Vladislav, 2016-01-11 15:43:00

Mysql what query to remove the character "-" from the column?

Hello!
The "oc_product_option_value" table has a "price" column and the values ​​are -45932 and so on. Prompt what request to remove the character "-" from the column?
And one more question: It is
necessary to delete all rows in the table that have the value "2" in the "language_id" column.
What query can do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2016-01-11
@yavladislav

UPDATE oc_product_option_value
SET price= REPLACE(price, '-', '');
DELETE FROM table_name WHERE language_id = 2

E
Eugene, 2016-01-11
@Nc_Soft

If type is numeric then ABS(price) if type is string then REPLACE(price, '-', '')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question