IBM Support

Denodo returns no rows when a query includes correlated subqueries

Troubleshooting


Problem

A SQL statement executed by Denodo returns no rows when the SQL statement includes a correlated subquery.

The following SQL statement uses a subquery to select rows in the tsuppliers table based on value of the rows in the tsupply table.
SELECT
    "sno" AS "SNO", 
    "pno" AS "PNO", 
    "qty" AS "QTY"
FROM
    "tsupply" "sp1" 
WHERE 
    "qty" > (
    SELECT
        AVG(CAST('double', "qty"))
    FROM
        "tsupply" "sp2" 
    WHERE 
        "sp2"."jno" = "sp1"."jno" AND
        "sp2"."sno" IN ( 
            SELECT
                "sno"
            FROM
                "tsuppliers" "s" 
            WHERE 
                "s"."sno" = "sp1"."sno" )
    )
ORDER BY 
    "SNO" ASC, 
    "PNO" ASC

Symptom

Denodo server version 7 and 8 incorrectly returns a result set with no rows.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSTSF6","label":"IBM Cognos Analytics"},"ARM Category":[{"code":"a8m0z0000001jkbAAA","label":"Reporting-\u003EPerformance"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"All Versions"},{"Product":{"code":"SS6G84","label":"IBM Cognos Analytics on Cloud"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}},{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
15 January 2026

UID

ibm17086155