On Wed, 1 Jan 2014 23:23:04 +0100
Petite Abeille <petite.abei...@gmail.com> wrote:

> Yes, a ?with? clause is just syntax sugar providing named subqueries.
> But this sugar open the door to drastically different ways to write
> queries, bringing structure, clarity of thoughts and purpose to
> otherwise labyrinthine constructs. 

That's an aesthetic judgement.  Even if I agreed, it doesn't change the
fact that every language feature is an element of complexity,
and redundant language features are needless complexity.  

WITH only creates another way to express something already
expressible in fewer words.  If the CTE appears only once in the query,
hardly anything is changed except that the subquery appears first.  

I have no objection to new syntax.  But it must add functionality to the
language.  It must allow the programmer to express the same query more
clearly and *succinctly*.  

> Think about ?with? clause as modern SQL syntax, in the same way as
> ANSI join syntax brings clarity of purpose to what otherwise would be
> a shambles of cross-purpose ?where? clauses.

Oh, I have lots of complaints about SQL!  ;-)   But the two aren't
really so analogous, because FROM ... ON added something new to the
language.  

The old FROM A, B WHERE has a pretty good basis in relational algebra.
But RA doesn't define outer joins (really the union of a join and
antijoin), and the syntax had problems expressing them. WHERE had (and
has) no way to refer to the inner table, so ON was invented.  

> Oh, and, also? Happy New Year! :)

And you the same.  :-)  

--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to