title: postgres select result
body: <p>if the data in table is :</p>
  
  <pre><code>select * from data;
  
   key  | value                    
  ------+---------
   a    | a_value
   b    | b_value
   c    | c_value
   d    | d_value
   e    | e_value
   f    | f_value
  </code></pre>
  
  <p>if one client connects to my web server and ask for the value of a, my application will try to do:</p>
  
  <pre><code>select value where key = 'c';
  </code></pre>
  
  <p>and send the result value to client</p>
  
  <p>if 3 clients connect to my web server, there are 3 statements occur,</p>
  
  <pre><code>  select value where key = 'e';  # client 1
  
    select value where key = 'c';  # client 2
  
    select value where key = 'a';  # client 3
  </code></pre>
  
  <p>for resource reason, I want to consolidate many statements into one select statement.</p>
  
  <pre><code>select * where key = 'e' or key = 'c' or key = 'a';
  
   key  | value                    
  ------+---------
   a    | a_value
   c    | c_value
   e    | e_value
  </code></pre>
  
  <p>but the problem is the sequence of result is not the same as my WHERE clause.
  so I cannot distinguish the result from the clients' query.
  if I want to send value back to the clients</p>
  
  <pre><code>'e_value' to client 1
  'c_value' to client 2
  'a_value' to client 3
  </code></pre>
  
  <p>thanks!!</p>