1
I’m trying to return the parent ID at the highest level in a query, this is the information:
ID NOME PARENT_ID
1 Project (null)
2 Sub 1
3 Sub-Sub 2
4 Sub-Sub-Sub 3
I need this:
ID NOME PARENT_ID FATHER_ID
1 Project (null) (null)
2 Sub 1 1
3 Sub-Sub 2 1
4 Sub-Sub-Sub 3 1
You want to return also the father ID "root", that’s it?
– Rodrigo Rigotti
That’s right @Rodrigorigotti
– Alessandro Gomes
It wouldn’t be the same
FATHER_ID
?– Antony Alkmim
How many levels?
– Leandro Amorim
FATHER_ID is what I need, I only have the father on the first level. I need the general parent. @Antonyalkmim
– Alessandro Gomes
@Leandroamorim can have N levels :(
– Alessandro Gomes
And you need it in SQL itself, or will use some client language?
– Bacco
Need in SQL friend @Bacco
– Alessandro Gomes
@Bacco I have a View of the information I need from Redmine and consume it by WSDL and my application only sends the parameters and receives the list. In this case I need to filter all the tasks of using only the ID of the main project, so I wanted to add this field in my View.
– Alessandro Gomes
@Bacco Tranquiloo! With the trial I believe that it would not work, already the function I think will work! I will make a test
– Alessandro Gomes
@Bacco worked perfectly! Thank you very much!
– Alessandro Gomes