if the data in table is :
select * from data;
key | value
------+---------
a | a_value
b | b_value
c | c_value
d | d_value
e | e_value
f | f_value
if one client connects to my web server and ask for the value of a, my application will try to do:
select value where key = 'c';
and send the result value to client
if 3 clients connect to my web server, there are 3 statements occur,
select value where key = 'e'; # client 1
select value where key = 'c'; # client 2
select value where key = 'a'; # client 3
for resource reason, I want to consolidate many statements into one select statement.
select * where key = 'e' or key = 'c' or key = 'a';
key | value
------+---------
a | a_value
c | c_value
e | e_value
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
'e_value' to client 1
'c_value' to client 2
'a_value' to client 3
thanks!!
I don’t quite understand your use-case, but a query like the following enables you to
Returns: