Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL)
-
None
Description
CREATE TABLE t1 (a INT, b INT, c INT);
|
CREATE TABLE t2 (d INT, e INT, f INT);
|
 |
INSERT INTO t1 VALUES (1,1,66), (1,1,38), (3,3,66);
|
INSERT INTO t2 VALUES (1,1,66), (1,12,32), (3,3,66);
|
The query that fails uses equalities. One of these equalities should be pushed into the WHERE clause and the two others into the HAVING clause.
SELECT *
|
FROM t2,
|
(
|
SELECT a, b, max(c) AS max_c
|
FROM t1
|
GROUP BY a
|
HAVING max_c > 37
|
) AS v1
|
WHERE (v1.a=1) AND (v1.b=v1.a) AND
|
(v1.a=t2.e) AND (v1.max_c=66);
|