tags:

views:

71

answers:

1

Hi, I have one weird requirement. In a SQL table, I have two columns of same type, say type ObjA. The values in these two columns repeats.

e.g.  ObjA_Column1    ObjA_Column2
      obj1               obj2  
      obj2               obj3
      obj1               obj2
      obj3               obj4
      obj4               obj5

I want a query that merge two column elements distinctively i.e.

ObjA_TembColumn
     obj1
     obj2
     obj3
     obj4
     obj5

Please help.

Thanks Pankaj

+2  A: 
dc.Table.Select(x => x.Column1).Union(dc.Table.Select(x => x.Column2))
leppie
Thanks Leppie. well.. that's is an easy one. But I forgot to mention that I also want to add the selection criteria supposedc.Table.Where(row=>row.Id == uid).Select(x => x.Column1).Union(dc.Table.Where(row=>row.Id == uid).Select(x => x.Column2))
Panks