title: order by case using SQL
body: <p>I have the following table:</p>
  
  <pre><code>+----+----------+-----+-----------+----------+
  | 1 | Ramesh   | 32 | Ahmedabad | 2000.00 |
  | 7 | Muffy    | 24 | Indore    | 10000.00 |
  | 6 | Komal    | 22 | MP       | 4500.00 |
  | 2 | Khilan   | 25 | Delhi     | 1500.00 |
  | 3 | kaushik  | 23 | Kota      | 2000.00 |
  | 5 | Hardik   | 27 | Bhopal    | 8500.00 |
  | 4 | Chaitali | 25 | Mumbai    | 6500.00 |
  +----+----------+-----+-----------+----------+
  </code></pre>
  
  <p>And, I am using the following query to sort the table as per my preferred order, but I am getting the following SQL error:</p>
  
  <blockquote>
    <p>CURSOR OPERATION CONFLICT</p>
  </blockquote>
  
  <p>My query:</p>
  
  <pre><code>SELECT * FROM CUSTOMERS ORDER BY (CASE ADDRESS WHEN 'DELHI'   THEN 1
  WHEN 'BHOPAL'   THEN 2
  WHEN 'KOTA'   THEN 3
  WHEN 'AHMADABAD' THEN 4
  WHEN 'MP'  THEN 5
  ELSE 100 END) ASC, ADDRESS DESC
  </code></pre>