Re: subquery bug ?
You need something like this (btw your results were wrong):
SELECT sb.id, sb.some_type, sb.some_name
FROM subquerybug sb
INNER JOIN
(
SELECT id, MAX(some_type) AS biggest_type
FROM subquerybug
GROUP BY id
) t1
ON (t1.id=sb.id AND sb.some_type=t1.biggest_type);
Also, try not to use reserved/special words (e.g. TYPE) for column names : it will save you from lots of headaches!
Subject
Written By
Posted
Re: subquery bug ?
March 11, 2017 02:27PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.