title: SQL: How to make a query, that checks if rows with certain value on a column, refer to a foreign key more than once?
body: <p>The database I'm working on has tables <code>services</code> and <code>orders</code>.</p>
  
  <p>Each <code>service</code> has a foreign key reference as a column <code>fk_order</code>.</p>
  
  <p>Now, services have a <code>type</code> column. Whenever a new <code>order</code> is created in the web-app, they'll automatically get a <code>service</code> the <code>type</code> of which is <code>'ORDERHANDLE'</code></p>
  
  <p>There was a bug at some point that MIGHT have created a situation where some <code>orders</code> would've ended up with more than one <code>service</code> with the <code>type</code> <code>'ORDERHANDLE'</code> referring to them. </p>
  
  <p>What I'd like to do now is to make a query, that checks if there are multiple (more than one) <code>service</code> rows with the type <code>'ORDERHANDLE'</code> referring to one <code>fk_order</code>. Because only one <code>ORDERHANDLE</code> <code>type</code> of <code>service</code> should be referring to one <code>order</code>.</p>
  
  <p>Thank you for any advice.</p>
  
  <p>Here is my query so far (yes I'm a noob.)</p>
  
  <pre><code>SELECT * FROM services
  INNER JOIN orders
  ON services.fk_order = order.id
  WHERE services.type = 'ORDERHANDLE'
  </code></pre>
  
  <p>I just have no idea how to proceed from there.</p>