Group functions of outer query inside inner query
- by superdario
Hello,
I'm using Oracle. I'm trying to compose something like this:
SELECT trans_type,
(SELECT parameter_value FROM transaction_details WHERE id = MAX(t.trans_id))
FROM
(SELECT trans_id, trans_type FROM transactions) t
GROUP BY trans_type
So, I am trying to use a result of grouping inside an inner query. But I am getting the error that I cannot use a group function inside the inner query:
ORA-00934: group function is not allowed here
Can you offer an alternative other than resorting to another outer query?