homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

Query to delete some characters from a column
or how to remove parts of a string

5+ Year Member

Msg#: 4387135 posted 1:33 pm on Nov 15, 2011 (gmt 0)

I search for an answer but couldnīt find one that work.

I have a column on a table with thousands of lines with values like:

... and so on

And I need to delete everything after -v16-, including the "-v16-".

Is it possible to do that in phpMyAdmin?



Msg#: 4387135 posted 1:59 pm on Nov 15, 2011 (gmt 0)

see documentation for substring_index function

select substring_index(your_field,'-',2)
from your_table

update your_table set your_field=substring_index(your_field,'-',2)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved