Re: [SQL] Common table expression - parsing questions

2009-10-03 Thread Thomas Kellerer
the6campbells wrote on 29.09.2009 04:54: 2. Do you intend to remove the requirement to include the recursive keyword - as other vendors allow The standard *requires* the keyword. As far as I can tell there are two DBMS that require it (Postgres, Firebird) and two that don't (SQL Server and

[SQL] Need even more magic. Now for tricky counts.

2009-10-03 Thread Andreas
Hi, there is a vast log-table that collects several state data for objects. (log_id, project_fk, object_fk, state_fk, log_type_fk, created_on::timestamp, ...) log_id is a sequence, project_fk foreign key on a project-table object_fk foreign key on a object-table state_fk can have 10 v

[SQL] Common table expression - parsing questions

2009-10-03 Thread the6campbells
Couple of questions: 1. Why does Postgres not throw a parsing error during sqlPrepare for this statement vs at sqlExecute with t_cte ( c1, ctr ) as ( select 1,0 from tversion union select 2,0 from tversion union all select c1, ctr + 1 from t_cte where c1=1 and ctr < 5 union all select c1, ctr + 1