MySQL Forums
Forum List  »  General

Re: #1241 - Operand should contain 1 column(s) - help?
Posted by: John Biddulph
Date: May 30, 2018 12:42PM

Thanks, I worked it out driving home, I needed to use INNER JOIN...

So this is what I have now an dit works:

SELECT cust.CustomerID, ct.userid, ct.firstname, cli.company
FROM tblcontacts as ct
INNER JOIN tblclients as cli
ON ct.userid = cli.userid
INNER JOIN customerold as cust
ON CONCAT(cust.Initials, cust.Surname) = CONCAT(ct.firstname, cli.company)

I now need to run an UPDATE Query, something like this:
UPDATE servicescopy
SET newCustomerID = ct.userid
FROM tblcontacts as ct
INNER JOIN tblclients as cli
ON ct.userid = cli.userid
INNER JOIN customerold as cust
ON CONCAT(cust.Initials, cust.Surname) = CONCAT(ct.firstname, cli.company)

but that errors:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM tblcontacts as ct
INNER JOIN tblclients as cli
ON ct.userid = cli.userid' at line 3

Options: ReplyQuote


Subject
Written By
Posted
Re: #1241 - Operand should contain 1 column(s) - help?
May 30, 2018 12:42PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.