I have a query that's selecting a bunch of fields related to names and addresses of customers but it boils down to:
SELECT DISTINCT a, b, c, ... FROM big_dumb_flat_table
it returns a bunch of records (10986590). When I replace the commas in the select-list to format it as a pipe-separated concatenated string:
SELECT DISTINCT a + '|' + b + '|' + c + '|' + ... FROM big_dumb_flat_table
it's returning 248 more records. I've reassured myself that there are no pipes in any of the fields that could be screwing the fidelity of the returned set. What's going on here?