<p>I've got a table of hardware and a table of incidents. Each hardware has a unique tag, and the incidents are tied to the tag.</p>

<p>How can I select all the hardware which has at least one incident listed as unresolved?</p>

<p>I can't just do a join, because then if one piece of hardware had multiple unresolved issues, it would show up multiple times.</p>

```
```
select distinct(hardware_name) 
from hardware,incidents 
where hardware.id = incidents.hardware_id and incidents.resolved=0;
```
```