OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: "Operand should contain 1 column" error

From: Jasper Bryant-Greene (jasperbryant-greene.name)
Date: Mon Sep 12 2005 - 23:28:39 CDT


Dave wrote:
>
> The situation:
> While trying to copy data over from one table to another, I have
> encountered the following error:
> #1241 - Operand should contain 1 column(s)
>
> The query that I used which led to this error was this:
> INSERT INTO forum_members( dateRegistered, realName, ID_MEMBER,
> memberName, emailAddress, active, keitai, number, admin, cardpic,
> cardbio, hofpic, hofbio, nickname, contactMe, showMe, websiteUrl )
> SELECT ( UNIX_TIMESTAMP( joindate ) , CONCAT_WS( ' ', firstname,
> lastname ) , id, username, email, active, keitai, number, admin,
> cardpic, cardbio, hofpic, hofbio, nickname, contactMe, showMe, website )
> FROM members
>

Have you tried removing the brackets ( ) from around the fields in the
SELECT part of the query? i.e.

INSERT INTO forum_members( dateRegistered, realName, ID_MEMBER,
memberName, emailAddress, active, keitai, number, admin, cardpic,
cardbio, hofpic, hofbio, nickname, contactMe, showMe, websiteUrl )
SELECT UNIX_TIMESTAMP( joindate ) , CONCAT_WS( ' ', firstname, lastname
) , id, username, email, active, keitai, number, admin, cardpic,
cardbio, hofpic, hofbio, nickname, contactMe, showMe, website
FROM members

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql