mysql - #1242 - Subquery returns more than 1 row - SQL Error -


why error, because seems subquery returns column product_id:

update `product_category` set `winner` =   (select product_id   (select product.product_id, product.category ranking join product join test  ranking.product = product.product_id , ranking.test = test.test_id , ranking.rang = 1  group product.product_id  order count(product.product_id) desc, product.price, product.name) winners       group winners.category order winners.category) 

why not work, because whole table returns in () has 1 column?


Comments

Popular posts from this blog

javascript - WinJS appendTextAsync producing scheduler errors -

minify - Minimizing css files -

Sockets with kotlin -