dbTalk Databases Forums  

adding information to existing existing data

comp.databases.mysql comp.databases.mysql


Discuss adding information to existing existing data in the comp.databases.mysql forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Auddog
 
Posts: n/a

Default adding information to existing existing data - 01-11-2008 , 02:21 PM






I have a table (inventory) with field (item_no) and would like to add some
information to the end of the existing data in the item_no field. In
example, item_no = 1234-01 would now be 1234-01(wp). I'm not quite sure
where to even start and I've never done anything like this and I have
several hundred items to update.


A



Reply With Quote
  #2  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: adding information to existing existing data - 01-11-2008 , 02:45 PM






On Fri, 11 Jan 2008 20:23:35 +0100, J.O. Aho wrote:
Quote:
Auddog wrote:
I have a table (inventory) with field (item_no) and would like to add some
information to the end of the existing data in the item_no field. In
example, item_no = 1234-01 would now be 1234-01(wp). I'm not quite sure
where to even start and I've never done anything like this and I have
several hundred items to update.

UPDATE table SET item_no=concat(item_no,'(wp)') WHERE item_no='1234-01';

Not that the WHERE clause doesn't have to be there, or can be based on
any other selection criteria you like, like a LIKE for part numbers
(WHERE item_no LIKE '123%') or even on a non-item_no column (maybe a
manufacturer), or omitted altogether.

--
45. I will make sure I have a clear understanding of who is responsible for
what in my organization. For example, if my general screws up I will not
draw my weapon, point it at him, say "And here is the price for failure,"
then suddenly turn and kill some random underling. --Evil Overlord List


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.