Domanda

I want to extract some value using a query, but it beats me everytime: In the picture below i draw my table content. enter image description here . 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

È stato utile?

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";
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top