Re: History of transitive closure queries

From: Lennart Jonsson <erik.lennart.jonsson_at_gmail.com>
Date: Fri, 09 Aug 2013 17:24:06 +0200
Message-ID: <ku31in$joj$1_at_dont-email.me>


On 08/09/2013 11:21 AM, Norbert_Paul wrote: [...]
> (2) When was WITH RECURSIVE first introduced into SQL? I know
> it is present in SQL 2003.
>

According to Mimers validator
(http://developer.mimer.com/validator/parser99/index.tml#parser) it was introduced in SQL99:

with recursive T (x) as (

    values 0
    union all
    select x+1 from T where x < 10
)
select x from T

Result:
The following features outside Core SQL-99 are used:

T121, "WITH (excluding RECURSIVE) in query expression"
T131, "Recursive query"
F661, "Simple tables"


The SQL92 parser
(http://developer.mimer.com/validator/parser92/index.tml#parser) gives:

Result:
with recursive T (x) as (

^---                 ^-
syntax error: with recursive
  correction: recursive

syntax error: as
  correction: JOIN

    values 0
    union all
    select x+1 from T where x < 10
)
select x from T
^-----
syntax error: ) select
  correction: EXCEPT select

^
syntax error: <end>

    expected: ) , . { <delimited identifier> <identifier> ABSOLUTE AS CROSS

              EXCEPT FULL GROUP HAVING INNER INTERSECT JOIN LEFT NATURAL RIGHT
              UNION WHERE
  correction: ) ON <identifier> = <identifier> <end>

/Lennart Received on Fri Aug 09 2013 - 17:24:06 CEST

Original text of this message