Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query help
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Query help
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01350738
Message ID:
01350738
Vues:
60
Hi All,

I have the OfferHeader and OfferDetail tables in a 1 to many relationship.

OfferHeader:
Batch
12345
67890


OfferDetail:
Batch EDP IsMainStock
12345 95 1
12345 96 0
12345 97 0
12345 98 0
67890 85 0
67890 86 1
67890 87 0

How can I structure a query to get the following result? Do I have to use a cursor or is there another way for example using PIVOT feature?


Result
Batch MainStockEDP ChildEDPs
12345 95 96|97|98
67890 86 85|87


Thank you,
Daniel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform