Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML path returns duplicate entries
Message
From
09/04/2013 23:47:38
 
 
To
09/04/2013 23:08:13
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01570554
Message ID:
01570555
Views:
35
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
Previous
Reply
Map
View

Click here to load this message in the networking platform