I'm looking for query that can return same results as two given queries:
select foo as res1 from table t where t.id in (1,2)
select foo as res2 from table t where t.id in (3,4)
I need something like:
select
(select foo from table t where t.id in (1,2)) as res1,
(select foo from table t where t.id in (3,4)) as res2
But all I get is error:
Subquery returned more than 1 value
Result that I need:
res1 | res2 |
---|---|
foo1 | foo3 |
foo2 | foo4 |
How can I get such result using only one query?