Link to home
Start Free TrialLog in
Avatar of abgsc
abgscFlag for Norway

asked on

Merge two rows in SQL

Hi,
we have created a view that shows info from many different tables joined together. the output look like this
SELECT * from view_Analysts
AS-IS result:
id  date              analyst  type    
1   10/10/2009   Smith     Lunch  
1   10/10/2009   Hall        Lunch  
2   12/11/2009   Smith     Lunch
3   13/11/2009   Jackson Group
3   13/11/2009   Harris     Group

TO-BE result
id  date              analyst              type
1   10/10/2009   Smith+Hall         Lunch
2   12/11/2009   Smith                 Lunch
3   13/11/2009   Jackson+Harris Group

When all columns, except analyst, is the same, then mergethe two rows into one row with a '+' sign in analyst column

How can I write my sql to get TO-BE output?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial