Guest User

Untitled

a guest
Oct 22nd, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. select core_subscription.id,core_order_product.* FROM core_order_product
  2. inner join
  3. (
  4. select core_order_product.order_id,product_name, MAX(order_create_date) as create_date,subscription_id from core_order_product inner join core_subscription_order on core_order_product.order_id = core_subscription_order.order_id group by product_name,subscription_id,core_order_product.order_id order by subscription_id
  5. )
  6. group_order_product ON core_order_product.order_create_date = group_order_product.create_date and core_order_product.company_id = group_order_product.company_id inner join core_subscription on core_subscription.id = group_order_product.subscription_id where core_order_product.company_id = 1032;
  7.  
  8. returning to many rows. because of that order_id
Add Comment
Please, Sign In to add comment