Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML path returns duplicate entries
Message
De
09/04/2013 23:47:38
 
 
À
09/04/2013 23:08:13
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01570554
Message ID:
01570555
Vues:
34
For some kind of reason, this is a syntax that works:
SELECT Client.Name,SUBSTRING(COALESCE((SELECT ', '+RTRIM(Invoice.ID)
 FROM ClientInvoice (NOLOCK)
 INNER JOIN Invoice ON Client.NoInvoice=Invoice.Numero
 WHERE ClientInvoice.NoClient=Client.Numero FOR XML PATH (''),TYPE).value('.','varchar(max)'),''),3,1000) AS InvoiceID
 FROM Client
I just do not understand how the other was working and I had to adjust it tonight to fix this issue.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform