Re: [SQL] functions are returns columns

2007-11-09 Thread Pavel Stehule
On 09/11/2007, Michele Petrazzo - Unipex srl <[EMAIL PROTECTED]> wrote: > Hi all. > I want that a function return a table rows (like the doc says at 33.4.4. > SQL Functions as Table Sources), but I want the a function return only a > few cols, so the same that I select into the func. > Modifying th

[SQL] functions are returns columns

2007-11-09 Thread Michele Petrazzo - Unipex srl
Hi all. I want that a function return a table rows (like the doc says at 33.4.4. SQL Functions as Table Sources), but I want the a function return only a few cols, so the same that I select into the func. Modifying the doc example: CREATE TABLE foo (fooid int, foosubid int, fooname text); INSERT

Re: [SQL] Select in From clause

2007-11-09 Thread Alvaro Herrera
Ray Madigan wrote: > I have never seen this done before, but it seems like it is supposed to work > from reading the manual. > > I want to be able to get a table name from another table and use it in the > from clause of a select. > > Something like > > SELECT * FROM (SELECT name FROM bar WHERE

[SQL] Select in From clause

2007-11-09 Thread Ray Madigan
I have never seen this done before, but it seems like it is supposed to work from reading the manual. I want to be able to get a table name from another table and use it in the from clause of a select. Something like SELECT * FROM (SELECT name FROM bar WHERE conditions) AS b WHERE b.condition =

Re: [SQL] Temporal databases

2007-11-09 Thread Keith Carr
Hi Philippe, Have a look at the post I made to the pgsql-sql list I made on 6th November 2007 (day before you posted this). It contains alot of stuff for temporal tables within Postgres. However temporal tables (when done properly) are a very complex subject at the best of times. It depends how

[SQL] design of tables for sparse data

2007-11-09 Thread Andreas
Hi, I need some help to improve my design skills. :) I lately read an article about table design, that teached one shouldn't designe tables where it's clear that some columns aren't relevant for every row. It didn't span into the dirty usage details beyond the table design. E.g. a really