0

I'm having a verry strange problem. I am certain I have done nothing wrong in this line of code:

INSERT INTO 
 oc_address     
  (`cust_id`, `firstname`, `lastname`, `address_1`, `city`, `postcode`, `country_id`)
SELECT          
  (`cust_id`, `first_name`, `last_name`, `address`, `city`, `postalcode`, `country`)
FROM    old_customer;

Still I get the message "#1241 - Operand should contain 1 column(s)"

Does anybony see something I don't see? I was thinking it may be caused by the _1 at address_1. But why would that be... I hope there is another explanation

4

2 回答 2

3

删除'列名的符号()SELECT.

  INSERT INTO 
  oc_address     
  (cust_id, firstname, lastname, address_1, city, postcode,country_id)
  SELECT          
  cust_id, first_name, last_name, address, city, postalcode, country
  FROM    old_customer;
于 2013-04-23T15:18:55.580 回答
3

删除ststement( )上的列周围,SELECT

INSERT  INTO oc_address (cust_id, firstname, lastname, address_1, city, postcode, country_id)
SELECT cust_id, first_name, last_name, address, city, postalcode, country
FROM    old_customer;
于 2013-04-23T15:19:06.847 回答