regex - how to create mysql view with REGEXP -



regex - how to create mysql view with REGEXP -

my table.value varchar. contains string '...totalvalue:xxxx,.... want create view extract xxxx fromvalue` , convert number column of view.

maybe this?

create view v_data select value regexp `.*,totalvalue:(.*),.*` (1).tonumber totalvalue table;

thanks much!!!

if can create select gives right reply can create view of select.

to extract parts of string utilize substr. find out start , end positions utilize in substr utilize locate ':' , ','.

select substr(test, locate(':', test) + 1, locate(',', test) - locate(':', test) - 1) test;

sqlfiddle

mysql regex view

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -