[REQ_ERR: 404] [KTrafficClient] Something is wrong. Enable debug mode to see the reason.
Sql stuff distinct
I've tried various combinations of distinct and group by in . Mar 23, · This gives me the output I'd expect, but I would like to eliminate the duplicate values in the stuff/for xml path field. Since SQL Server , the trick of using FOR XML PATH to denormalize strings and combine them SELECT DISTINCT UserID, Bands = STUFF. . Mar 23, Use select distinct in the subquery: select rainer-daus.dee, count(distinct rainer-daus.de), stuff((select distinct ', ' + cast(rcA. Use select distinct in the subquery: select rainer-daus.dee, count (distinct rainer-daus.de), stuff ((select distinct ', ' + cast (rainer-daus.de as varchar (max)) from Receiving rcA where rainer-daus.deer = 'user' and rainer-daus.deME > '' and rainer-daus.dee = rainer-daus.dee for xml path ('')), 1, 2, '') from Receiving rc where rainer-daus.deer = 'user' and rainer-daus.deME > '' group by rainer-daus.dee;. The default varies by context and you are (potentially) introducing a bug that is really hard to find. This formulation assumes that Event does not have XML special characters. In SQL Server, never use varchar () (or related types) without a length. You want the stuff () to remove two characters, not 1, because you have a comma followed by a space. The SELECT DISTINCT statement is used to return only distinct (different) values. Inside a table, a column often contains many duplicate values; . The SQL SELECT DISTINCT Statement. Is SQL DISTINCT good (or. SQL SELECT DISTINCT: Performance Best Practices. September 06, • Database development, Statements.