SQL Developer 中表或视图对象上的感叹号
我使用 Oracle SQL 开发人员 https://www.oracle.com/database /technologies/appdev/sqldeveloper-landing.html 来建模我的表和视图。 创建视图时,我在视图元素旁边看到警告符号:
我的视图代码:
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;
问题: 在哪里可以检查我的查询有什么错误?为什么当我按“测试查询”时它会显示结果并且查询成功。
也许全屏图片会有所帮助:
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:
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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并不意味着有错误。这意味着我们还没有在视图下解析 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.