SQL Developer 中表或视图对象上的感叹号

发布于 2025-01-12 09:53:07 字数 1416 浏览 0 评论 0原文

我使用 Oracle SQL 开发人员 https://www.oracle.com/database /technologies/appdev/sqldeveloper-landing.html 来建模我的表和视图。 创建视图时,我在视图元素旁边看到警告符号:

table 旁边的警告符号

我的视图代码:

CREATE OR REPLACE VIEW cards_restaurants AS
    SELECT
        *
    FROM
        (
            SELECT
                l.loyaltycardid,
                COUNT(r.restaurants_id) AS times_purchased,
                nvl(SUM(p.price), 0)    AS money_spent
            FROM
                loyalty_cards  l
                LEFT JOIN orders         o ON o.loyaltycardid = l.loyaltycardid
                LEFT JOIN restaurants    r ON r.restaurants_id = o.restaurants_id
                LEFT JOIN order_products op ON op.orderid = o.orders_id
                LEFT JOIN products       p ON p.products_id = op.products_id
            GROUP BY
                l.loyaltycardid
        )
    WHERE
        money_spent > 0
    ORDER BY
        money_spent DESC;

问题: 在哪里可以检查我的查询有什么错误?为什么当我按“测试查询”时它会显示结果并且查询成功。

也许全屏图片会有所帮助:

Oracle SQL 开发人员窗口

I use Oracle SQL developer https://www.oracle.com/database/technologies/appdev/sqldeveloper-landing.html to model my tables and views.
When I create view I see warning symbol next to view element:

warning symbol next to table

My code for view:

CREATE OR REPLACE VIEW cards_restaurants AS
    SELECT
        *
    FROM
        (
            SELECT
                l.loyaltycardid,
                COUNT(r.restaurants_id) AS times_purchased,
                nvl(SUM(p.price), 0)    AS money_spent
            FROM
                loyalty_cards  l
                LEFT JOIN orders         o ON o.loyaltycardid = l.loyaltycardid
                LEFT JOIN restaurants    r ON r.restaurants_id = o.restaurants_id
                LEFT JOIN order_products op ON op.orderid = o.orders_id
                LEFT JOIN products       p ON p.products_id = op.products_id
            GROUP BY
                l.loyaltycardid
        )
    WHERE
        money_spent > 0
    ORDER BY
        money_spent DESC;

QUESTION: Where can I check what error my query has? And why when I press "test query" it shows results and that query is successful.

Maybe a full screen picture could help:

Oracle SQL developer window

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北凤男飞 2025-01-19 09:53:08

这并不意味着有错误。这意味着我们还没有在视图下解析 SQL...因为它很昂贵,并且当您从数据字典导入时,您可能会拥有数百个 SQL。

我在这里讨论这个

右键单击视图,选择“解析” - 然后图片将更新,您将看到您的视图正在点击的表格列表。

免责声明:我是 Oracle 的产品经理,Data Modeler 是我的产品之一。

That doesn't mean there's an error. It means we haven't parsed the SQL under the view...because it's expensive, and you could have hundreds of those when you do an import from your data dictionary.

I talk about this here

Right click on the view, select 'parse' - then the picture will update and you'll see a list of tables your view is hitting.

Disclaimer: I'm a product manager at Oracle, and Data Modeler is one of my products.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文