oracle - count of product with parent_category_id -


i have 2 tables table 1: cat_a

enter image description here

table 2:prod_a

enter image description here

out put must

when category_id =1 product_id count must 7  when category_id = 3 product_id count must 5 when category_id = 6 product_id count must 3 when category_id = 7 product_id count must 2 when category_id = 5 product_id count must 2 

please me . have searched lot of questions , answers , forums. couldn't find exact solutions. don't want spoon feeding answers . please mention hint or way answer.

my problem resloved.

select count( product_id) prod_a   category_id in (select category_id cat_a  start category_id = <i_category_id>      connect prior category_id = parent_catogory); 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -