0

I hope that someone can help me to do this.

I have this result of a query that have the id with the columns of the 2 providers that is a bool parameter,

    Id Prov1 Prov2
    10 true false
    10 false true

with this result I want to join the result in one row with SQL 2008, that finish:

    Id Prov1 Prov2
    10 true true

There are a form to do this with a query?,

Thanks.

4

1 回答 1

1

试试这个:

SELECT t.Id, MAX(t.Prov1), MAX(t.Prov2) 
FROM MyTable t
GROUP BY t.Id
于 2013-10-15T20:15:16.803 回答