• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 10818
  • Last Modified:

MySQL - copy data from one column to another in the same table

I have a table as shown below, how can I copy the contents from itemName to itemDescb
I need to copy from one column to another column in the same table.


CREATE TABLE `products` (
  `PID` int(11) NOT NULL auto_increment,
  `prodcode` varchar(10) default NULL,
  `cat` varchar(40) NOT NULL default '',
  `subcat` varchar(40) default NULL,
  `itemName` varchar(50) default NULL,
  `itemDesc` text,
  `itemDescb` varchar(40) default NULL,
  `itemPrice` decimal(6,2) default '0.00',
  `special` decimal(6,2) default NULL,
  PRIMARY KEY  (`PID`),
  UNIQUE KEY `id` (`PID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

Thanks in advance for your help.
0
sabecs
Asked:
sabecs
  • 2
1 Solution
 
Raynard7Commented:
update products set itemDescb = itemName
0
 
sabecsAuthor Commented:
Thanks Raynard7.
0
 
Raynard7Commented:
no worries - glad to help
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now