I recently transferred a Magento website from one webhost to another. Frontend part is working fine. I am able to view products and cms pages. I am also able to view the admin login page. However, when try logging to admin, I get error page showing the following SQL query:
SELECT `e`.*, SUM((e.base_subtotal-IFNULL(e.base_subtotal_refunded,0)-IFNULL(e.base_subtotal_canceled,0)-IFNULL(e.base_discount_amount,0)+IFNULL(e.base_discount_refunded,0))*e.base_to_global_rate) AS `revenue`, SUM((e.base_tax_amount-IFNULL(e.base_tax_refunded,0)-IFNULL(e.base_tax_canceled,0))*e.base_to_global_rate) AS `tax`, SUM((e.base_shipping_amount-IFNULL(e.base_shipping_refunded,0)-IFNULL(e.base_shipping_canceled,0))*e.base_to_global_rate) AS `shipping`, COUNT(e.entity_id) AS `quantity` FROM `sales_order` AS `e` WHERE (e.entity_type_id = '11') AND (e.created_at >= '2013-06-03 07:52:54' and e.created_at <= '2013-06-04 07:52:54') AND (e.state != 'canceled') GROUP BY `e`.`entity_type_id`
I couldn’t find proper solution over the internet. Then, I typed the above SQL query on my database (using phpMyAdmin) and found that sales_order table doesn’t exist.
This helped me solve my silly mistake. The problem was that the database was not fully/completely imported. Some tables were not imported. I dropped all the tables and re-imported the database. This solved the issue.
Hope it helps.
Thanks.