<s>
A	O
hierarchical	O
query	O
is	O
a	O
type	O
of	O
SQL	B-Language
query	I-Language
that	O
handles	O
hierarchical	B-General_Concept
model	I-General_Concept
data	O
.	O
</s>
<s>
In	O
standard	O
SQL:1999	B-Language
hierarchical	O
queries	O
are	O
implemented	O
by	O
way	O
of	O
recursive	O
common	O
table	O
expressions	O
(	O
CTEs	O
)	O
.	O
</s>
<s>
Unlike	O
Oracle	B-General_Concept
's	O
earlier	O
connect-by	O
clause	O
,	O
recursive	O
CTEs	O
were	O
designed	O
with	O
fixpoint	O
semantics	O
from	O
the	O
beginning	O
.	O
</s>
<s>
Recursive	O
CTEs	O
from	O
the	O
standard	O
were	O
relatively	O
close	O
to	O
the	O
existing	O
implementation	O
in	O
IBM	B-Application
DB2	I-Application
version	O
2	O
.	O
</s>
<s>
Recursive	O
CTEs	O
are	O
also	O
supported	O
by	O
Microsoft	B-Application
SQL	I-Application
Server	I-Application
(	O
since	O
SQL	B-Language
Server	O
2008	O
R2	O
)	O
,	O
Firebird	B-Application
2.1	I-Application
,	O
PostgreSQL	B-Application
8.4	I-Application
+	I-Application
,	O
SQLite	B-Language
3.8.3	I-Language
+	I-Language
,	O
IBM	B-Application
Informix	I-Application
version	O
11.50	O
+	O
,	O
CUBRID	B-Application
,	O
MariaDB	B-Application
10.2	I-Application
+	I-Application
and	O
MySQL	B-Application
8.0.1	I-Application
+	I-Application
.	O
</s>
<s>
TIBCO	O
Spotfire	O
does	O
not	O
support	O
CTEs	O
,	O
while	O
Oracle	B-General_Concept
11g	I-General_Concept
Release	O
2	O
's	O
implementation	O
lacks	O
fixpoint	O
semantics	O
.	O
</s>
<s>
A	O
common	O
table	O
expression	O
,	O
or	O
CTE	O
,	O
(	O
in	O
SQL	B-Language
)	O
is	O
a	O
temporary	O
named	O
result	O
set	O
,	O
derived	O
from	O
a	O
simple	O
query	O
and	O
defined	O
within	O
the	O
execution	O
scope	O
of	O
a	O
SELECT	O
,	O
INSERT	O
,	O
UPDATE	O
,	O
or	O
DELETE	O
statement	O
.	O
</s>
<s>
CTEs	O
can	O
be	O
thought	O
of	O
as	O
alternatives	O
to	O
derived	O
tables	O
(	O
subquery	O
)	O
,	O
views	B-Language
,	O
and	O
inline	O
user-defined	O
functions	O
.	O
</s>
<s>
Common	O
table	O
expressions	O
are	O
supported	O
by	O
Teradata	O
(	O
starting	O
with	O
version	O
14	O
)	O
,	O
IBM	B-Application
Db2	I-Application
,	O
Informix	B-Application
(	O
starting	O
with	O
version	O
14.1	O
)	O
,	O
Firebird	B-Application
(	O
starting	O
with	O
version	O
2.1	O
)	O
,	O
Microsoft	B-Application
SQL	I-Application
Server	I-Application
(	O
starting	O
with	O
version	O
2005	O
)	O
,	O
Oracle	B-General_Concept
(	O
with	O
recursion	O
since	O
11g	O
release	O
2	O
)	O
,	O
PostgreSQL	B-Application
(	O
since	O
8.4	O
)	O
,	O
MariaDB	B-Application
(	O
since	O
10.2	O
)	O
,	O
MySQL	B-Application
(	O
since	O
8.0	O
)	O
,	O
SQLite	B-Language
(	O
since	O
3.8.3	O
)	O
,	O
HyperSQL	B-Application
,	O
Informix	B-Application
(	O
since	O
14.10	O
)	O
,	O
Google	B-Application
BigQuery	I-Application
,	O
Sybase	B-Application
(	O
starting	O
with	O
version	O
9	O
)	O
,	O
Vertica	O
,	O
H2	B-Language
(	O
experimental	O
)	O
,	O
and	O
many	B-Application
others	I-Application
.	O
</s>
<s>
Oracle	B-General_Concept
calls	O
CTEs	O
"	O
subquery	O
factoring	O
"	O
.	O
</s>
<s>
The	O
RECURSIVE	O
keyword	O
is	O
not	O
usually	O
needed	O
after	O
WITH	O
in	O
systems	O
other	O
than	O
PostgreSQL	B-Application
.	O
</s>
<s>
In	O
SQL:1999	B-Language
a	O
recursive	O
(	O
CTE	O
)	O
query	O
may	O
appear	O
anywhere	O
a	O
query	O
is	O
allowed	O
.	O
</s>
<s>
Some	O
Databases	O
,	O
like	O
PostgreSQL	B-Application
,	O
support	O
a	O
shorter	O
CREATE	O
RECURSIVE	O
VIEW	O
format	O
which	O
is	O
internally	O
translated	O
into	O
WITH	B-Language
RECURSIVE	I-Language
coding	O
.	O
</s>
<s>
An	O
alternative	O
syntax	O
is	O
the	O
non-standard	O
CONNECT	O
BY	O
construct	O
;	O
it	O
was	O
introduced	O
by	O
Oracle	B-General_Concept
in	O
the	O
1980s	O
.	O
</s>
<s>
Prior	O
to	O
Oracle	B-General_Concept
10g	O
,	O
the	O
construct	O
was	O
only	O
useful	O
for	O
traversing	O
acyclic	O
graphs	O
because	O
it	O
returned	O
an	O
error	O
on	O
detecting	O
any	O
cycles	O
;	O
in	O
version	O
10g	O
Oracle	B-General_Concept
introduced	O
the	O
NOCYCLE	O
feature	O
(	O
and	O
keyword	O
)	O
,	O
making	O
the	O
traversal	O
work	O
in	O
the	O
presence	O
of	O
cycles	O
as	O
well	O
.	O
</s>
<s>
CONNECT	O
BY	O
is	O
supported	O
by	O
Snowflake	B-General_Concept
,	O
EnterpriseDB	B-Language
,	O
Oracle	B-General_Concept
database	I-General_Concept
,	O
CUBRID	B-Application
,	O
IBM	B-Application
Informix	I-Application
and	O
IBM	B-Application
Db2	I-Application
although	O
only	O
if	O
it	O
is	O
enabled	O
as	O
a	O
compatibility	O
mode	O
.	O
</s>
