MySQL embeded select help

admin

Administrator
Staff member
Hi,
Im used to using oracle and either creating a view or embedding a select as a file so it creates the table on the fly, BUT am unable to do this in MySQL. Can anyone help please?

ie
I have 2 tables Orders, Products and want to add the shipping cost on orders to the total products cost.

select o.orders_id, o.date_purchased,
op.goods_price, o.shipping_cost,
op.goods_price + o.shipping_cost total_val,
o.orders_status
from (select op1.orders_id, sum(op1.final_price * op1.products_quantity) goods_price
from orders_products op1
group by op1.orders_id) op,
orders o
where op.orders_id = o.orders_id
order by o.orders_status, o.orders_id
 
Back
Top