I am trying to combine data from 3 semi-related tables:
Customer_List
Product_List
Product_Sales
The desired result is as follows:
5 Columns
Expand|Select|Wrap|Line Numbers
- Customer_Name Product_Name Product_IDNumber Sales Quantity
- ============= ============ ================ ===== ========
- Store 1 Product 1 Product ID #1 $0.00 5
- Store 1 Product 2 Product ID #2 $1.00 3
- Store 1 Product 3 Product ID #3 $2.00 8
- Store 2 Product 1 Product ID #1 $2.00 2
- Store 2 Product 2 Product ID #2 $1.00 4
- Store 2 Product 3 Product ID #3 $5.00 7
Expand|Select|Wrap|Line Numbers
- SELECT
- Product_List.Product_Name
- Product_List.Product_IDnumber
- Product_Sales.Sales
- Product_Sales.Quantity
- FROM Customer_List,Product_List,Product_Sales
- WHERE Customer_List.RandomID = Product_Sales.RandomID AND
- Product_Sales.Code00 = Product_List.Code00 AND
- Customer_List.Customer_Name like '%Acme%' AND
- Product Sales.Year = 2014
- Order by Customer_List.Customer_Name
Store 1 Product 1 Product ID #1 $0.00 5
Store 1 Product 2 Product ID #2 $0.00 5
Store 1 Product 3 Product ID #3 $0.00 5
I ran it last night at 5pm. This morning, the query was still executing.
There is not that much data for the query to run that long.
I am new to SQL.
Unfortunately, I cannot be more specific about the data; however, this example accurately describes what I am trying to accomplish.
Any help is greatly appreciated!