Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8751943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:08:31+00:00 2026-06-13T13:08:31+00:00

I have a master table like this Product Status Product id A True 1

  • 0

I have a master table like this

Product    Status  Product id
A          True     1
B          True     2
C          true     3
D          True     4
E          false    5
F          True     6

Now I have other table which is giving me the dependency of the product

Product    DependencyId
C             2
C             5
E             1
B             4
B             6

Now when I searching for C, I can see that two products are dependent upon C now these two product is dependent upon other products.

And let say I am searching for E, then I there are only one dependency of the product.

Now, I need to check for a product that if any dependency is false or not. If any of the dependency is false then I have to return some text/value.

Result

When product is C then output will be E (because the grand children of C (i.e. E) has false)

When product is B then output will be NULL (becuase none of the child of B or their sub childrens has false)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:08:32+00:00Added an answer on June 13, 2026 at 1:08 pm
    Declare @cnt int
    
    Select * 
    into #tmp
    from mastera where Product_ID in (Select DependencyID from dbo.dependency where Product='C')
    
    select @cnt=0
    while @cnt<>(Select count(*) from #tmp)
    begin 
        Select @cnt=count(*) from #tmp
        insert into #tmp
        Select m.* 
        from mastera m
        Left join  #tmp on m.Product=#tmp.Product 
        where m.Product_ID in (Select DependencyID from dbo.dependency where Product in (Select Product from #tmp where status=1))
        and #tmp.Product is null
    end
    
    
    Select * from #tmp  where Status=0
    
    Drop table #tmp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a master table called parent and a related table called childs Now
I have a Master Table and a Detail Table(like Categories and Products) in SQL
Situation looks like this: We have product 'A123' and we have to remember lowest
Using MySQL 5 I have a table like this: date (varchar) door (varchar) shift
I have a master table like CityName, Month, Temperature A,Jan,20 .... A,Dec,1 B,Jan,30 ....
I have an Access 2007 table called Master which contains, among many many others,
Table one: products Which have fields like products_id products_price master_categories_id Table two: specials .
I saw this link (http://stackoverflow.com/questions/6603868/android-onclicklistener-and-table-layout) which seems like it works for the person asking
I have JTable which elements property binded to List of objects, this is master
Hello I have a table structure like this products_id | model_num | master_model_num 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.