Gossamer Forum
Home : General : Databases and SQL :

Easier way for a select?

Quote Reply
Easier way for a select?
I have something like:

Code:
ID | FatherID | Deep | Name

1 | 0 | 0 | First level
2 | 1 | 1 | Second level
3 | 2 | 2 | Third level


Now i need:

1. select Name, FatherID from cat where ID = 3;
then
2. select Name, FatherID from cat where ID = result from 1
then
3. select Name from cat where ID = result from 2

to show:

Name Level 0 > Name Level 1 > Name Level 2

For shure something like this should be in GT and will search for it in a minute, but maybe someone knows an easier query for me than this three ones?

Last edited by:

Robert: Mar 28, 2014, 8:50 AM
Subject Author Views Date
Thread Easier way for a select? Robert 7672 Mar 28, 2014, 7:56 AM
Thread Re: [Robert] Easier way for a select?
Andy 7495 Mar 28, 2014, 12:30 PM
Thread Re: [Andy] Easier way for a select?
Robert 7487 Mar 28, 2014, 2:56 PM
Thread Re: [Robert] Easier way for a select?
Andy 7530 Mar 29, 2014, 12:50 AM
Thread Re: [Andy] Easier way for a select?
Robert 7514 Mar 30, 2014, 10:45 AM
Thread Re: [Robert] Easier way for a select?
Andy 7529 Mar 30, 2014, 11:47 PM
Thread Re: [Andy] Easier way for a select?
Robert 7405 May 3, 2014, 4:41 PM
Post Re: [Robert] Easier way for a select?
Andy 7336 May 3, 2014, 10:58 PM