I having trouble in my sql query .Please see my
example

As u see, the inventory Report is the parent for the stock alert and stock movement report.
Now i got a question. How can i select the parent’s read access to become ‘Y’ when there has any child record which has ‘Y’ read_access? On the other hand , if there aren’t any existing child record which has ‘Y’, the parent read_acess will become ‘N’
Sorry for my bad english. Please help
This should work:
It will give you duplicates, though (2 rows for
Inventory Report, one forStock Alert Reportand one forStock Movement Report) You can resolve this with aSELECT DISTINCT…OR, I believe adding a GROUP BY in the children table will solve the duplicate:
Now, you will still get a duplicate if there is a child that has
READ_ACCESSofYand another that hasREAD_ACCESSofN. However, this sounds like something that would need to be discussed with your business rules anyway.