Re: [SQL] JOIN syntax

2000-06-25 Thread Thomas Lockhart
> Looking at SQL92, it seems that I ought to be able to do this: > SELECT * FROM invoice INNER JOIN > (SELECT * FROM invoice_line WHERE lineno > 1) > ON invoice.invno = invoice_line.invno; > ERROR: parser: parse error at or near "(" Wrong syntax (for Postgres anyway). We don't yet have subsele

[SQL] JOIN syntax

2000-06-25 Thread Oliver Elphick
Looking at SQL92, it seems that I ought to be able to do this: SELECT * FROM invoice INNER JOIN (SELECT * FROM invoice_line WHERE lineno > 1) ON invoice.invno = invoice_line.invno; ERROR: parser: parse error at or near "(" (I know it can be successfully expressed in a more complex WHERE clause

[SQL] finding (and recycling) holes in sequences

2000-06-25 Thread Louis-David Mitterrand
If one has a unique-id generating sequence that sometimes is bound to have holes in it (ie: it could happen that a nextval(seq) happens without a corresponding INSERT in the table), then how could one efficiently scan for these holes to recycle them in subsequent INSERTs? I'm just looking for a "