select data from 6 tables
Hi,
I have a problem .I need to select the data from the 6 tables but the problem I am facing is it is not showing the full details as it is referencing all the tables and is showing the data which matches in all the tables.
I want to retreive product_name,company_name with all its details for which I am firing the query as
SELECT
A.COMPANY_PROFILE , F.PRODUCT_TYPE , F.PRODUCT_SIZE , F.PRODUCT_FINISH , B.PRODUCT_APPLICATION
, D.PRODUCT_COLOR , C.PRODUCT_CATEGORY , E.PRODUCT_PICTURE , D.PRODUCT_NAME
FROM
COMPANY A
, PRODUCT_APPLICATION B
, PRODUCT_CATEGORY C
, PRODUCT_MASTER D
, PRODUCT_PICTURE E
, PRODUCT_PRICE F
WHERE
(B.PRODUCT_NAME = D.PRODUCT_NAME)
AND (B.COMPANY_NAME = D.COMPANY_NAME)
or
(C.PRODUCT_NAME = D.PRODUCT_NAME)
AND (C.COMPANY_NAME = D.COMPANY_NAME)
or
(D.COMPANY_NAME = A.COMPANY_NAME)
AND (E.PRODUCT_NAME = D.PRODUCT_NAME)
AND (E.COMPANY_NAME = D.COMPANY_NAME)
or
(F.PRODUCT_NAME = D.PRODUCT_NAME)
AND (F.COMPANY_NAME = D.COMPANY_NAME)
and A.company_name='ABC'
The Result which this query is showing doesnot cover all the products present in the product master.
Please help me so that I can retreive all the product_name from product_master with their details in the corresponding tables as already mentioned above.
Thanx
Manoj
/