oracle中如何避免重复?
SELECT title, retail, (SELECT AVG(retail)
FROM books)
FROM books
WHERE retail < (SELECT AVG(retail)
FROM books)
有没有办法缩短其中之一 (SELECT AVG(retail) 从书籍)到别名?
SELECT title, retail, (SELECT AVG(retail)
FROM books)
FROM books
WHERE retail < (SELECT AVG(retail)
FROM books)
Is there a way to shorten one of (SELECT AVG(retail)
FROM books) to an alias?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
或使用WITH:
Try this:
or using a WITH:
您可以使用
WITH
子句进行重构,也许像这样:you could refactor with the
WITH
clause, maybe like this: