Clubbing three queries that return mutually exclusive records There is a table in Oracle database with the following data 

+----+-----+-------+---------+---------+---------+
| Id | Key | Value | Is_Orig | Is_Prev | Is_Curr |
+----+-----+-------+---------+---------+---------+
|  1 |  10 |  1000 |       1 |       0 |       0 |
|  2 |  10 |  2000 |       0 |       0 |       0 |
|  3 |  10 |  3000 |       0 |       1 |       0 |
|  4 |  10 |  4000 |       0 |       0 |       1 |
|  5 |  20 |   100 |       1 |       0 |       0 |
|  6 |  20 |   300 |       0 |       1 |       0 |
|  7 |  20 |   400 |       0 |       0 |       1 |
|  8 |  30 |    10 |       1 |       0 |       0 |
+----+-----+-------+---------+---------+---------+


I need to query the table and display the data as follows 

+-----+------------+------------+------------+
| Key | Orig Value | Prev Value | Curr Value |
+-----+------------+------------+------------+
|  10 |       1000 | 3000       | 4000       |
|  20 |        100 | 300        | 400        |
|  30 |         10 | n/a        | n/a        |
+-----+------------+------------+------------+


I was thinking on the following lines. 

SELECT t1.key, t1.orig_value, t2.prev_value, t3.curr_value 
FROM (
(SELECT key, value as orig_value
 FROM statistics
 WHERE is_orig = 1
) AS t1, 
(SELECT key, value as prev_value
 FROM statistics
 WHERE is_prev = 1
) AS t2, 
(SELECT key, value as curr_value
 FROM statistics
 WHERE is_curr = 1
) AS t3
)


This works; but is there a better way to get the desired result? 

Kindly note that is_orig=1, is_prev=1, and is_curr=1 are all mutually exclusive of each other. Hence, the three separate queries.
You can use aggregation like this:

select "Key", 
   MAX(CASE WHEN "Is_Orig" = 1 THEN "Value" END) "Orig Value",
   MAX(CASE WHEN "Is_Prev" = 1 THEN "Value" END) "Prev Value",
   MAX(CASE WHEN "Is_Curr" = 1 THEN "Value" END) "Curr Value"
from statistics
group by "Key"


The CASE statements select the value in each case and return NULL in the other cases. MAX is just to get that one value from the nulls.

Have a look at https://modern-sql.com/use-case/pivot for some background. It also refers to an Oracle specific feature called "modeling" that allows a similar thing.