title: Use case expression for conditions that aren't grouped
body: <p>I am using a case expression in a query to output device descriptions in a custom column if the USB device id is matched.  There will be multiple of the same base deviceid per machine due their usually being multiple devices from the manufacturer sharing a USB dongle or something.</p>
  
  <p>The issue I am running into is two device manufacturers have the same base device ids. I can't know exactly every full device id and which manufacturer it belongs to, all I can do is go off the first parts. One of the manufacturers will list their name in a column for the unifying receiver, but not for the mouse and or keyboard or whatever else there may be that shows for the computer.</p>
  
  <p>This all comes from wmi under win32_usbDevice.  So right now I have a case exppression where if deviceid like '%XXXXX%' and manufacturer like '%Logitech%' then 'Logitech Unifying Dongle'. But as I said for the mouse and keyboard or whatever else may be attached that has the same base device id the manufuctuerer will just be generic "standard system device" or "standard usb host controller"  etc.  For these I cannot know if belongs to device manufacturer 1 or if it belongs to the other.  I can assume that if of one of the devices matching that based id has logitech as manufacturer then the rest that show for that computer are logitech input devices.  I would like to include this logic in the case expression but this is what I do not know how to do without grouping the results based on computer name or declaring a variable for the computer name or something.  </p>
  
  <p>Here is an example of the results I get for one machine. </p>
  
  <p><a href="https://i.stack.imgur.com/Pjo6T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pjo6T.png" alt="enter image description here"></a></p>
  
  <p>So is there any way I can use case or if for this?  Like if deviceid like '%046D&amp;PID_C525B%' and [USB Device Name] not like '%Logitech%' but machine name is the same as same row returned with Logitech then 'Logitech Devices'
  end as device description.</p>