0

I have managed to produce a result set into a temp table which looks like below.

col1    col2    col3    col4    col5
------------------------------------
1        1       1       1       0
1        1       1       0       1
2        2       2       2       0
2        2       2       0       2

So in effect I would like col4 and col5 to read

col4            col5
----------------------
1               1
2               2

As I am using SQL Server 2005, I am unable to use merge.

Please can someone advise what function would be best to use to get my desired outcome.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user3482471
  • 227
  • 1
  • 4
  • 14

0 Answers0