How do you exclude multiple rows if one of the rows meets the condition?
<table>
<th>Instruction_ID</th>
<th>Instruction_Desc</th>
<tr>
<td>1</td>
<td>Please use these products:</td>
</tr>
<tr>
<td>1</td>
<td>Kerlix</td>
</tr>
<tr>
<td>1</td>
<td>Sodium Chloride</td>
</tr>
<tr>
<td>1</td>
<td>Tegaderm</td>
</tr>
<tr>
<td>2</td>
<td>Please use these products</td>
</tr>
<tr>
<td>2</td>
<td>Sodium Chloride</td>
</tr>
</table>
I'm trying to exclude all rows for a given instruction_id if one of the rows in the group has the word "Kerlix." The desired output would be:
<table>
<th>Instruction_ID</th>
<th>Instruction_Desc</th>
<tr>
<td>2</td>
<td>Please use these products</td>
</tr>
<tr>
<td>2</td>
<td>Sodium Chloride</td>
</tr>
</table>
You can do
self join
AND useleft join