title: MySQL count distinct where detections occur in three of five receivers for triangulation
body: <p>I have a list of radiotransmitter detections, and in order to process the data for triangulation, I need to be sure that the site has had three or more receivers ping out. </p>
  
  <p>The data look like this (except in my real table it is a single DATETIME field): </p>
  
  <pre><code>Date    Time    Receiver    Location    Array   Transmitter
  4/30/2013   6:14:34 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:17:11 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:19:21 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:20:37 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:22:05 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:23:55 AM  119736   D/s L side 1   A69-1303-48591
  4/30/2013   6:23:57 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:26:35 AM  119736   D/s L side 1   A69-1303-48591
  4/30/2013   6:26:37 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:28:52 AM  119736   D/s L side 1   A69-1303-48591
  4/30/2013   6:28:53 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:30:20 AM  119736   D/s L side 1   A69-1303-48591
  4/30/2013   6:30:22 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:32:13 AM  119736   D/s L side 1   A69-1303-48591
  4/30/2013   6:32:15 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:32:16 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:34:57 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:34:58 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:37:18 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:37:19 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:38:55 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:38:56 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:41:07 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:42:25 AM  119732   D/s R side 1   A69-1303-48591
  4/30/2013   6:42:26 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:43:59 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:46:00 AM  119740   U/s R side 1   A69-1303-48591
  4/30/2013   6:57:12 AM  113177  U/s Site 1  1   A69-1303-48591
  </code></pre>
  
  <p>As you can see, this fish (A69-1303-48591) hit at least three of the receivers (119732, 119736, 119740, 113177) within an hour, so I can triangulate his movements. Here is my novice attempt at coding something: </p>
  
  <pre><code>SELECT * FROM  detections WHERE 
  ((
  recID_Detection = '113177' OR recID_Detection = '119732' OR recID_Detection = '119736'
  ) AND 
  (recID_Detection = '119740' 
  ))
  OR
  ((
  recID_Detection = '113177' OR recID_Detection = '119732' OR recID_Detection = '119740'
  ) AND 
  (recID_Detection = '119736' 
  ))
  OR
  ((
  recID_Detection = '113177' OR recID_Detection = '119736' OR recID_Detection = '119740'
  ) AND 
  (recID_Detection = '119732' 
  ))
  OR
  ((
  recID_Detection = '119732' OR recID_Detection = '119736' OR recID_Detection = '119740'
  ) AND 
  (recID_Detection = '113177' 
  ))
  GROUP BY transmitter
  ;
  </code></pre>
  
  <p>This code results in an empty set (which it shouldn't) even without the GROUP BY and doesn't even have a time constraint (which it should), so I am sure I've done something improper, but I can't find anything similar to what I want to do in the literature. </p>