title: SELECT DISTINCT in Scala slick
body: <p>I am using Slick 1, and I have to be able to apply a filter in a query to lookup all entities that match a condition in a related table.</p>
  
  <p>This example using the Slick documentation shows what I am trying to do (this is a contrived example that is close to my situation).</p>
  
  <p>Here, I want all coffees that are provided by suppliers on the west coast.  I want the Coffee only, I am only interested in navigating to Suppliers to apply the filter:</p>
  
  <pre><code>val westCoast = Seq("CA", "OR", "WA")
  val implicitInnerJoin = for {
    c &lt;- Coffees
    s &lt;- Suppliers if c.supID === s.id &amp;&amp; s.state inSet westCoast
  } yield c
  </code></pre>
  
  <p>This works ok, but it will duplicate Coffees if there is more than one match in the Suppliers table.</p>
  
  <p>The obvious workaround is in normal SQL to do a SELECT DISTINCT; however, I cannot find a way to do that here.</p>
  
  <p>You could in theory do a:</p>
  
  <pre><code>query.list.distinct
  </code></pre>
  
  <p>After the results are already returned; however, I have also implemented PAGING support, so you wouldn't want to process the results once the already come back from the database.  Here is the paging support:</p>
  
  <pre><code>query.drop(offset).take(limit).list
  </code></pre>
  
  <p>So, in a nutshell, I <em>need</em> a way to specify SELECT DISTINCT in my query that goes out.</p>
  
  <p>Anyone have any ideas?</p>