title: MySQL query SELECT inside IN
body: <p>I'm new in SQL, have a comlpex query for me which choose only one cheapest line from each cityId to each cityId:</p>
  
  <pre><code>SELECT cityIdFrom, cityIdTo, MIN(fromToPrice) fromToPrice_min 
  FROM pricing
  WHERE cityIdFrom IN (91, 94, 95, 99)
  AND cityIdTo IN (91, 94, 95, 99)
  GROUP BY cityIdFrom, cityIdTo
  </code></pre>
  
  <p>So we take cheapest from 91 to 94, cheapest from 91 to 95 etc. How can I fix this query to SELECT lines for cityIdFrom 91 only when column Bull IS 1.
  For example, if we have:</p>
  
  <pre><code>cityIdFrom - cityIdTo - fromToPrice - Bull
  91, 94, 3000, 0
  91, 94, 5000, 1
  91, 95, 1000, 0
  91, 99, 1500, 1
  99, 95, 2000, 0
  </code></pre>
  
  <p>Our query will give us:</p>
  
  <pre><code>91, 94, 5000, 1
  91, 99, 1500, 1
  99, 95, 2000, 0
  </code></pre>
  
  <p>Thank for help!</p>