Hi, I'm still using SQL Server 2000 and have view created from joining 5 different tables. My problem is that in this view for specific ID I got multiple rows as result since data in one column is different, for example I got:
1 1 1 1 1 1 2 1 1 1 1 3 1 1 1
Since I need this view for mail merging I was wondering if it is possible to have results in this form:
1 1,2,3 1 1 1
Without repeating 3 times? All solved in my view query.
Then you will nee to aggregate it somehow or concatenate CONCAT( the results set for one column. By using case statements you can create new columns based on the information from the 3 rows thus condensing the 3 down to single/multiple column outputs. Otherwise if you are talking about repeats on the rows you can use a sub query to return the row you want by using row_number() over(partition