lundi 7 juillet 2014

convert string to mysql query using regex


Vote count:

0




i make update by mistake in column in mysql database it become like this way



ID keyword Default_value
1 header_HOME EXCURSIONS
2 header_APARTMENTS EXCURSIONS
3 header_Excursions EXCURSIONS
4 header_Sea_Excursions EXCURSIONS
5 header_Desert_Safari EXCURSIONS
6 header_Sight_Seeing EXCURSIONS
7 header_Shore_excursions EXCURSIONS
8 header_Plan_excursions EXCURSIONS
9 header_Others EXCURSIONS
10 header_Hotels EXCURSIONS


now i want to update my database with this pattern


column 1 - ID is the first number in every line (the same no change )


column 2 - keyword the same value with patter word_word (the same no change )


column 3 - the word or words in column 2 with out first word and '' and also change every '' to ' ' one space


like UPDATE my_table SET keyword = 'header_Sea_Excursions' where id=4



asked 3 mins ago

tito11

1,846





Aucun commentaire:

Enregistrer un commentaire