title: how to select SQL , ownerID 7 first then all from table USER ?(with OR condition )
body: <p>The USER table structure is</p>
  <pre><code>id owneeId  delete shop
  
  1   12       null    1
  2   13       1       0
  3   12       null    1
  4   7        1       1
  5   7        null    1
  6   13       null    1
  7   16       null    1
  8   17       null    1
  </code></pre>
  <p><strong>Now I am getting the result of ( query given below )</strong></p>
  <pre><code>select * from users WHERE ownerId in ('12', '13') and delete is null  or    
  ownerId not IN ('12','13')  and shop=1 and delete is null
  </code></pre>
  <p>I will get all users with owner id 12 or 13 (with delete null) + all users with owner id not 12 or 13 + shop =1 and dlete is null.</p>
  <p><strong>Desired result</strong></p>
  <p>I will give another ownerID 7.</p>
  <p>I need to get all the users with owner id 7 first, that means; from above table ,</p>
  <p><strong>all users with owner id 7 and shop =1 first ...only then all users with owner id 12 or 13 (with delete null) + all users with owner id not 12 or 13 + shop =1 and dlete is null</strong></p>
  <p>query will be something like</p>
  <p>I need to add &quot;<strong>select * from users where ownerId 7 first and shop 1 and delete null</strong>&quot; to the query(above one, this one below- both same query)</p>
  <pre><code>select * from users WHERE ownerId in ('12', '13') and delete is null  or    
      ownerId not IN ('12','13')  and shop=1 and delete is null
  </code></pre>
  <p>** (PS)EDIT FOR BETTER CLARITY**</p>
  <p>My current result is</p>
  <pre><code>id owneeId  delete shop
  
  1   12       null    1
  2   12       null    1
  2   7        null    1
  2   13       null    1
  2   16       null    1
  2   17       null    1
  </code></pre>
  <p>what I need is- desired result</p>
  <pre><code>id owneeId  delete shop
  
  2   7        null    1
  1   12       null    1
  2   12       null    1
  2   13       null    1
  2   16       null    1
  2   17       null    1
  </code></pre>
  <p>all user with ownerid 7 first , then the rest...( I am getting this result as an array of objects in node , in sql as table)</p>
  <p>PS : Owner id can be any number, in this case it is 7. It can be 912, 989,89009,...etc</p>