Ulrike

How to query order items

Recommended Posts

Hi everybody,

I am using MySQL to query data from our Magento database. 

The table m2epro_amazon_order contains general information on each order (order_id, amazon_order-id, buyer_name, buyer_email, shipping_address ...). However, it does not contain information on which product has been sold. 

Then, there is the table m2epro_amazon_order_item with the products sold. Each has an order_item_id an an amazon_order_item_id. 

The question is, how do I connect those two tables as there is no obvious foreign key in m2epro_amazon_order_item that refers to m2epro_amazon_order. Is there a "bridge" across other tables that allows me to join this information?

Looking forward to your replies!

 

Ulrike 

 

Share this post


Link to post
Share on other sites

m2epro_order record + m2epro_amazon_order record = completed record

m2epro_order_item record + m2epro_amazon_order_item  record = completed record

 

you should consider these tables together, assuming, that they have one-to-one relation.

if you undestand this you will find an answer of your question himself.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.