0

Here is the update I'm trying to run:

UPDATE  oc_product_gpf SET
brand =  '(select name from oc_manufacturer where manufacturer_id=
(select manufacturer_id from oc_product where product_id = oc_product_gpf.product_id) )'
WHERE  oc_product_gpf.gpf_id =2454;

The error I'm receiving is '#1406 - Data too long for column 'brand' at row 1'

Any suggestions? Thanks in advance!

2
  • 2
    that's not a subquery. it's a STRING containing some text that LOOKS like a query. but since it's a string, that "kinda looks like sql" is NOT executed. Remove the '. Commented Oct 19, 2016 at 15:50
  • See meta.stackoverflow.com/questions/333952/… and try to explain what you're actually trying to do. Commented Oct 19, 2016 at 15:56

1 Answer 1

2

Your subquery not acting as a subquery here. it simply act as a string and trying to assign to "brand" column. Please remove the '' or convert that in to a join

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.