[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

mysql delete some alphabet from record

Posted on 2010-11-24
5
Medium Priority
?
428 Views
Last Modified: 2012-05-10
How can i delete some title from colum b

Mr.David   change to  David
MissSusan  Change to  Susan
0
Comment
Question by:teera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:teera
ID: 34210719
hi expert
  Miss or Mr   or Mrs must be in the first  if somepeople name  samrart  it should not elete mr from his name
0
 
LVL 24

Expert Comment

by:jimyX
ID: 34210721
update table TableName set b = 'David' where b = 'Mr.David';
update table TableName set b = 'Susan' where b = 'MissSusan';
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1000 total points
ID: 34210730
I presume you want this:

UPDATE yourtable SET b = SUBSTRING(b, 4, 1000)
  WHERE b LIKE 'Mr.%';
UPDATE yourtable SET b = SUBSTRING(b, 4, 1000)
  WHERE b LIKE 'Mr %';
UPDATE yourtable SET b = SUBSTRING(b, 5, 1000)
  WHERE b LIKE 'Miss%';

Open in new window

0
 

Author Comment

by:teera
ID: 34210734
Hi jimyX

  some people they nor name David
0
 
LVL 7

Assisted Solution

by:mkobrin
mkobrin earned 1000 total points
ID: 34210769
UPDATE yourtable SET b = SUBSTRING(b, 4,)
  WHERE b LIKE 'Mr.%';
UPDATE yourtable SET b = SUBSTRING(b, 4)
  WHERE b LIKE 'Mr %';
UPDATE yourtable SET b = SUBSTRING(b, 5)
  WHERE b LIKE 'Miss%';
UPDATE yourtable SET b = SUBSTRING(b, 4)
  WHERE b LIKE 'Mrs%';
UPDATE yourtable SET b = SUBSTRING(b, 5)
  WHERE b LIKE 'Mrs.%';
UPDATE yourtable SET b = SUBSTRING(b, 6)
  WHERE b LIKE 'Miss.%';





0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question