0

The Sales Order Grid Not Working And It's Gives this kind of error when search by sku

"Something went wrong with processing the default view and we have restored the filter to its original state."

enter image description here

in exception.log file i found this king of error.

[2022-02-11 06:08:55] main.CRITICAL: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sku' in 'where clause', query was: SELECT COUNT() FROM sales_order_grid AS main_table WHERE (sku LIKE '%GGM6001%') {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sku' in 'where clause', query was: SELECT COUNT() FROM sales_order_grid AS main_table WHERE (sku LIKE '%GGM6001%') at /mnt/data/home/489837.cloudwaysapps.com/wxvjjsqbbs/public_html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:110, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sku' in 'where clause' at /mnt/data/home/489837.cloudwaysapps.com/wxvjjsqbbs/public_html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91)"}

1 Answer 1

0

Your Query is wrong. Because their is no column like sku in sales_order_grid table. Your query should be like below query.

SELECT COUNT(*) FROM sales_order_grid AS main_table WHERE (SELECT sku from sales_order_item where main_table.entity_id=sales_order_item.order_id AND sku LIKE '%GGM6001%')

First run your query in table manually than implement in your file. Hope this help you.

enter image description here

6
  • no this query not work for me
    – Jay Parmar
    Commented Mar 14, 2022 at 11:35
  • What output came after implementing this query in your table?
    – krishna
    Commented Mar 15, 2022 at 5:54
  • shred out put above
    – Jay Parmar
    Commented Mar 22, 2022 at 12:45
  • It perfectly working for me. If you are still getting same error then please check query because your error represent that their are no column like SKU in sales_order_grid and you are trying to fetch it. So once again check query given by me because it working fine for me.
    – krishna
    Commented Mar 22, 2022 at 12:54
  • my sales order grid table not present sku column
    – Jay Parmar
    Commented Mar 22, 2022 at 13:04

Your Answer

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

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