Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Child and parent on same table
Message
De
30/03/2004 17:39:38
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Child and parent on same table
Divers
Thread ID:
00891025
Message ID:
00891025
Vues:
54
Hi,

I have a table like this:

id parent descr
---- ------ -----
1 - house
2 - cat
3 - dog
4 3 chair
5 - bed
6 2 lap

Let's say I want to grab the id = 4 but at the same time I want to grab the parent of 4 also, so the result should be

id parent descr
---- ------ -----
4 3 chair
3 - dog

What is the easiest way to do this in one Select Statement?

Thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform