Query to fetch data from two different tables
Posted on 2008-11-07
I have two tables orders, and order_details. Now I want to write a query which will fetch the sum of order amount group by year and the sum total product quantity for that year from its detail.
Here are the table structure,
- id (PK)
- order_id (FK)
Formula for total is (total_amount + shipping_charges + gift_wrap_charges - discount_amount)
I am using MySQL database.
Shahzad Fateh Ali