Skip to content

Instantly share code, notes, and snippets.

@oliverlundquist
Created November 5, 2015 02:25
Show Gist options
  • Save oliverlundquist/c64dc327c4a55e16bad3 to your computer and use it in GitHub Desktop.
Save oliverlundquist/c64dc327c4a55e16bad3 to your computer and use it in GitHub Desktop.
select
CAST(SUM(`o_p`.`cost` * `o_p`.`count`) as UNSIGNED) as `cost`,
CAST(SUM(`o_t`.`subtotal`) as UNSIGNED) as `subtotal`,
CAST(SUM(`o_t`.`shipping_fee`) as UNSIGNED) as `shipping_fee`,
CAST(SUM(`o_t`.`payment_fee`) as UNSIGNED) as `payment_fee`,
CAST(SUM(`o_t`.`wrapping_total`) as UNSIGNED) as `wrapping_total`,
CAST(SUM(`o_t`.`points_discount`) as UNSIGNED) as `points_discount`,
CAST(SUM(`o_t`.`total`) as UNSIGNED) as `total`
from
order_products as o_p,
order_totals as o_t
where
o_p.order_id AND o_t.order_id
IN (186840,186841,186842,186843,186844)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment