Magento 1.7 – Get SKU and Order ID Through SQL Query

databasemagento-1.7MySQL

I want to get SKU and Order ID from Magento database and I know how to get them individually. The problem is I need to get SKU for the product that the order id points towards. I can't figure out the relation between sales_order_flat_table and catalogue_product_entity. I think there are other tables in between that I am missing. May be I should use some id in sales_flat_order_table to get product id and then get SQL.

Best Answer

you should use also the following tables and fields in your query: sales_flat_order_item [quote_item_id]

sales_flat_quote_item [product_id]

Related Topic