三津石智巳

👦🏻👦🏻👧🏻 Father of 3 | 🗺️ Service Reliability Engineering Manager at Rakuten Travel | 📚 Avid Reader | 👍 Wagashi | 👍 Caffe Latte | 👍 Owarai

【感想】Pro Oracle SQL Development : Best Practices for Writing Advanced Queries

CTEsについて勉強中。

"Common table expressions are also known as the WITH clause, or subquery factoring."

via Check out this quote from Pro Oracle SQL Development : Best Practices for Writing Advanced Queries - https://learning.oreilly.com/nullhtml/471418_1_En_6_Chapter.xhtml

  • CTEs
  • WITH clause
  • subquery factoring

は全て同じ。

"A correlated subquery is found in the SELECT or WHERE clause and references a column value from the outer query. An inline view is a subquery in the FROM clause."

via Check out this quote from Pro Oracle SQL Development : Best Practices for Writing Advanced Queries - https://learning.oreilly.com/library/view/pro-oracle-sql/9781484245170/html/471418_1_En_6_Chapter.xhtml

  • SELECT or WHERE clauseにあるのがcorrelated subquery
  • FROM clauseにあるのがinline view
  • どちらも広義のsubquery

"In Oracle, this feature is also called subquery factoring, and the grammatically awkward “WITH clause.”"

via Check out this quote from Pro Oracle SQL Development : Best Practices for Writing Advanced Queries - https://learning.oreilly.com/library/view/pro-oracle-sql/9781484245170/html/471418_1_En_7_Chapter.xhtml

Oracleでは、

  • common table expressions
  • subquery factoring
  • WITH clause

は同じものを指す。

"Oracle provides two ways to process hierarchical data: the original CONNECT BY syntax and the newer recursive common table expressions syntax (also known as recursive subquery factoring)."

via Check out this quote from Pro Oracle SQL Development : Best Practices for Writing Advanced Queries - https://learning.oreilly.com/library/view/pro-oracle-sql/9781484245170/html/471418_1_En_7_Chapter.xhtml

CTEsの応用とし、recursive queriesを一般的に学ぶのが良さそう。