title: Prioritize certain rows where to versions exist
body: <p>I have a pricing table for users</p>
  
  <pre><code>pid | price | service | package | interval | user
  1   | 1     | 1       | 10      | w        | 0
  2   | 4     | 1       | 10      | m        | 0
  3   | 3     | 1       | 10      | m        | 1
  4   | 2     | 1       | 20      | w        | 0
  5   | 8     | 1       | 20      | m        | 0
  6   | 5     | 1       | 25      | w        | 0
  7   | 20    | 1       | 25      | m        | 0
  8   | 4     | 1       | 25      | w        | 1
  9   | 4     | 1       | 15      | w        | 1
  10  | 16    | 1       | 15      | m        | 1
  </code></pre>
  
  <p>rows with 0 hold general prices for everybody. Now I sometimes give discounts to certain users. This price will have a user's id as user.</p>
  
  <p>Now I want a query that selects all prices for a user. It should take all prices where the user is 0 or where the user is the id of a user but if there is a row with 0 as user and the user id as user it should only take the row with the user id as user.</p>
  
  <pre><code>SELECT * FROM `prices` WHERE user = 0 OR user = 1 AND [...]
  </code></pre>
  
  <p>should return</p>
  
  <pre><code>pid | price | service | package | interval | user
  1   | 1     | 1       | 10      | w        | 0
  3   | 3     | 1       | 10      | m        | 1
  4   | 2     | 1       | 20      | w        | 0
  5   | 8     | 1       | 20      | m        | 0
  7   | 20    | 1       | 25      | m        | 0
  8   | 4     | 1       | 25      | w        | 1
  9   | 4     | 1       | 15      | w        | 1
  10  | 16    | 1       | 15      | m        | 1
  </code></pre>