cancel
Showing results for 
Search instead for 
Did you mean: 

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_yearly.product_

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_yearly.product_

Hi all,

 

I was running updates in Magento connect manager, and something went wrong. 
When trying to log on to the backend we are faced with the below error. Any ideas on how to fix this?

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_yearly.product_type_id' in 'field list', query was: SELECT COUNT(*) FROM (SELECT MAX(DATE_FORMAT(period, '%Y-%m-%d')) AS `period`, SUM(qty_ordered) AS `qty_ordered`, `sales_bestsellers_aggregated_yearly`.`product_id`, MAX(product_name) AS `product_name`, MAX(product_price) AS `product_price`, `sales_bestsellers_aggregated_yearly`.`product_type_id` FROM `sales_bestsellers_aggregated_yearly` WHERE (EXISTS (SELECT 1 FROM `catalog_product_entity` AS `existed_products` WHERE (sales_bestsellers_aggregated_yearly.product_id = existed_products.entity_id))) AND (store_id IN(0)) GROUP BY `product_id` LIMIT 5) AS `t`

 

2 REPLIES 2

Re: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_yearly.prod

Hi @reaFU

 

Looks like you have - product_type_id column is not there in sales_bestsellers_aggregated_yearly table into your database !

 

so exactly you need to identify from where this - product_type_id field is coming because its not there in native table db !!

 

so either you need to delete this column or need to identify and share from where its added 

 

Hope it helps !!

 

 

if issue solved,Click Kudos & Accept as Solution

Re: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_yearly.prod

Hello @reaFU,

 

Check this table `f4p_sales_bestsellers_aggregated_yearly` have `product_type_id` columns in it.

If `product_type_id` column is in table then `re-index` and refresh cache.

If `product_type_id` column is not in table then you need to create (upload backup table) table again.

 

Thank you.