I am working on oracle hierarchical query for the below table
Classification_Product
and Order_details
tables
Classification Product has the Classification_id
which will be stored in the Order_details
according to user selection
I want to select all products from Order_details
table that has a parent LED Screen
which will return all product that has parent LED Screen
no matter what the child is 32inch or 50 inch or sony samsung etc etc
I tried to use below query but its replate rows a lot
SELECT B.CLASSIFICATION_ID, LEVEL AS VLEVEL, A.CATEGORY_ID, A.CATEGORY_DESC, CONNECT_BY_ISLEAF AS leaf
FROM PRODUCT_CLASSIFICATION A, ORDER_DETAILS B
WHERE A.STATUS = 1 and b.created_on like sysdate--AND leaf =1
START WITH A.CATEGORY_ID IS NULL
CONNECT BY A.CATEGORY_ID = PRIOR A.CLASSIFICATION_ID
ORDER SIBLINGS BY A.CLASSIFICATION_ID;