Skip to content
Advertisement

Select values from table having a field value same as another field value

I have the following columns in a table : FDA_ID and FDA_ID_PARENT and the following set of data:

I have the FDA_ID = 773 as entry data and want to get those ‘linked’ to it.

What I mean by linked is those FDA_ID having the same FDA_ID as the FDA_ID_PARENT of FDA_ID = 773 and those having the same FDA_ID_PARENT as the FDA_ID_PARENT of FDA_ID = 773.

So in the case of FDA_ID = 773, the query would return FDA_ID = 771, 772 and 773.

I have tried the below query but it does not work:

Any help please?

Advertisement

Answer

The second part of your WHERE clause returns all rows that have a parent set.

You may want to use something like (or any parts of it):

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement