Yassine edouiri Yassine edouiri - 6 months ago 8
SQL Question

MYSQL query will remove characters from a string

I would like to implement a query in MYSQL that will remove the characters before the space

For example :


UA 016


i want to remove 'UA ' with the space , and only keep


016


here is the query statements:

update field_data_field_id set field_id_value = '.... what i need here';


Thanks in advance

Answer
UPDATE field_data_field_id 
SET field_id_value=SUBSTRING_INDEX(
                     SUBSTRING_INDEX(field_id_value,' ',2),' ',-1);
Comments