# Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use of this software will be governed # by the Apache License, Version 2.0. # Regression test for https://github.com/MaterializeInc/database-issues/issues/2327. statement ok CREATE TABLE t2 (f1 DOUBLE PRECISION, f2 DOUBLE PRECISION NOT NULL); statement ok INSERT INTO t2 VALUES (1, 1); statement ok INSERT INTO t2 VALUES (2, 2); query II SELECT * FROM (SELECT COUNT (*) AS f1 FROM t2) a1, (SELECT MAX (f1) AS f2 FROM t2) a2 WHERE 1 NOT IN (a1.f1 + a2.f2); ---- 2 2 query II SELECT AVG ( a1 .f2 ) , MIN ( a1 .f1 ) FROM ( SELECT COUNT ( TRUE ) f1 , AVG ( a2 .f2 ) AS f2 FROM t2 a2 ) a1 LEFT JOIN ( SELECT TRUE f1 , MAX ( a1 .f1 ) f2 FROM t2 a1, t2 ) a2 ON 1 NOT IN ( a1 .f1 + a2 .f2 , 2 ) ; ---- 1 2