Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Merge two tables in one on one rows!!!
Message
De
23/08/2002 10:00:24
Martin Thibault
Minière Québec Cartier
Port-Cartier, Québec, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Merge two tables in one on one rows!!!
Divers
Thread ID:
00692894
Message ID:
00692894
Vues:
49
Hi every body, Is it possible to merge two tables in one with only one SELECT-SQL? The first table is the parent and the second is the children. I want the select SQL return me the result on one row per parent!!!

Example:
table constructors (parent) table drivers (children)
NAME_CONST (fields) NAME_CONST, NAME_DRIVER
---------- ---------- -----------
Ferrari Ferrari Michael Schumacher
Williams Ferrari Rubbens Barrichello
Bar Williams Ralph Schumacher
Renault Williams Juan Pablo Montoya
Bar Jacques Villeneuve


The number of childrens can be different for each parent, i don't know the maximum of childrens, and the minimun can be zero!!!

I would like the result of the SQL select seem like that:

NAME_CONST NAME_DRIVER1 NAME_DRIVER2
---------- ------------ ------------
Bar Jacques Villeneuve (NULL)
Ferrari Michael Schumacher Rubben Barrichello
Renault (NULL) (NULL)
Williams Ralph Schumacher Juan Pablo Montoya

I works with Sql Server 2000!!!

Thanks!!!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform