You need is a self join. The query will look like this:
SELECT a.name
FROM test a, test b
WHERE a.parentID = b.id AND b.name="T1";
Domanda
I want to extract some value using a query, but it beats me everytime: In the picture below i draw my table content. . All of the information you need, it is in the picture. I want to extract the following values : Test1,Test2,Test3,Test4 - where name = "T1". How can I do that? thx
Soluzione
You need is a self join. The query will look like this:
SELECT a.name
FROM test a, test b
WHERE a.parentID = b.id AND b.name="T1";