PowerCenter
- PowerCenter 10.5
- All Products
Table
| Columns
|
---|---|
ORDERS
|
|
CUSTOMERS
|
|
PRODUCTS
|
|
SELECT AVG(O.PRICE_PER_UNIT), C.CUSTOMER_ID, C.LAST_ORDER_DATE, P.PRODUCT_ID, O.UNITS_SOLD, O.PRICE_PER_UNIT, (O.UNITS_SOLD*O.PRICE_PER_UNIT) AS TRANSACTION_AMOUNT FROM CUSTOMERS C, ORDERS O, PRODUCTS P WHERE (O.CUSTOMER_ID=C.CUSTOMER_ID AND P.PRODUCT_ID=O.PRODUCT_ID AND C.customer_ID IN (SELECT UNIQUE(C.CUSTOMER_ID) FROM CUSTOMERS C)) GROUP BY C.CUSTOMER_ID, C.LAST_ORDER_DATE, P.PRODUCT_ID