I can not create grouped product from the admin panel it gives the below error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'position' in 
'order clause', query was: SELECT `e`.*, `at_status`.`value` AS 
`status`, `links`.`link_id` FROM `catalog_product_entity` AS `e` INNER 
JOIN `catalog_product_entity_int` AS `at_status` ON 
(`at_status`.`entity_id` = `e`.`entity_id`) AND
(`at_status`.`attribute_id` = '94') AND (`at_status`.`store_id` = 0)
INNER JOIN `catalog_product_link` AS `links` ON links.linked_product_id
= e.entity_id AND links.link_type_id = 3 INNER JOIN 
`catalog_product_entity` AS `product_entity_table` ON links.product_id = 
product_entity_table.entity_id WHERE (((`e`.`required_options` != 1) OR
(`e`.`required_options` IS NULL))) AND (at_status.value IN(1, 2)) AND 
(links.product_id = 687) AND (`e`.`entity_id` != '687') ORDER BY 
`position` ASC

What caused that error, Thanks in advance.


I have used that sql statements to clear the DB from products, customers and categories prior to deploy


You're getting the error because the last part of the query is ambiguous:

ORDER BY `position` ASC

I don't know if you're using custom or community modules, or if this is just core code, but to fix it, I recommend troubleshooting the code that's creating the query and ensuring that all columns are specified correctly. It should look like:

ORDER BY table_alias.`position` ASC

where table_alias is replaced with the name or alias of the table that this column is coming from.

Hope this helps. Your question doesn't have lots of details, and it sounds like this is an issue with custom code, so if you could post any of that, that would be helpful...

Please let me know if you have any questions!


This worked for me https://github.com/magento/magento2/issues/4621#issuecomment-269324410

thanks to sumanta-cn .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.