Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sql statement mysql

Posted on 2011-02-24
4
Medium Priority
?
339 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
4 Comments
 
LVL 24

Accepted Solution

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

Assisted Solution

by:Ovid Burke
Ovid Burke earned 500 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 500 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 500 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

971 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