Home : General : Databases and SQL :

General: Databases and SQL: Easier way for a select?: Edit Log

Here is the list of edits for this post
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

Edit Log: