I'm trying to figure out the most concise way to achieve the following result set:
[![enter image description here](https://i.stack.imgur.com/pSQ8c.png)](https://i.stack.imgur.com/pSQ8c.png)

given this input data:  

[![enter image description here](https://i.stack.imgur.com/i2eJU.png)](https://i.stack.imgur.com/i2eJU.png)

Notice that rows 1 and 3 of the input data consist of the same item+bucket combination. Rows with a source of 'mandate' are supposed to take precedence over rows with a source of 'forecast' for matching item+bucket combinations when generating the result set. In cases where item+bucket combinations have no duplication due to difference sources, those rows are to appear in the final result set regardless of their source.

Here is the code for the input data:

```html
declare @t table
(
  source varchar(20) not null,
  item int not null,
  bucket date not null,
  quantity int not null,
  primary key clustered (source, item, bucket)
);

insert into @t values
('forecast', 8501, '9/1/2016', 100),
('forecast', 8528, '9/1/2016', 100),
('mandate', 8501, '9/1/2016', 200),
('mandate', 8530, '9/1/2016', 200);

select * from @t;
```