Solved

sql statement mysql

Posted on 2011-02-24
4
335 Views
Last Modified: 2012-05-11
please suggest sql state ment to update

such as
645 change to dd645
478 change to dd478

inmy sql statement
         
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
4 Comments
 
LVL 24

Accepted Solution

by:
jimyX earned 125 total points
ID: 34977052
update YourTable set YourCloumn=concat("dd",YourCloumn);
0
 
LVL 11

Assisted Solution

by:Ovid Burke
Ovid Burke earned 125 total points
ID: 34977065
Try:
UPDATE tablename SET fieldname = CONCAT('dd',fieldname);

Open in new window

0
 
LVL 17

Assisted Solution

by:Shinesh Premrajan
Shinesh Premrajan earned 125 total points
ID: 34977096
Above one are correct, This will hit only the records that are defined in the where condition.

UPDATE tablename SET fieldname = CONCAT('dd',fieldname) where fieldname in ('645','478');

0
 
LVL 7

Assisted Solution

by:waltersnowslinarnold
waltersnowslinarnold earned 125 total points
ID: 34977140
You can use the below format as well,
UPDATE tableName
SET
fieldName = 'dd'+fieldName

Open in new window

0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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