Re: [SQL] SQL report

2009-08-02 Thread wkipjohn
Hi Rob, I have default B-Tree indexes created for each of the indexed columes and primary key columes. (No multiple columes indexe or NULL FIRST or DESC/ASC). I am using PostgreSQL 8.3 with the auto vacuum daemon on. I assume analyse will be automatically run to collect statistics for use b

Re: [SQL] SQL report

2009-08-02 Thread wkipjohn
Hi Steve, Thanks for you suggestions. In my senario, what is current depends on users. Because if user wants a status report at 00:00 1st Jan 2009, then 00:00 1st Jan 2009 is current. So it is not possible to flag any records as current unless the user tells us what is current. cheers Joh

Re: [SQL] Tweak sql result set... ?

2009-08-02 Thread Axe
> i think jasen is thinking of manipulating the result set in your programming > enviroment not in the database. > btw from the point of "clean programming" it's a bad idea to integrate > html-elements directly into your database quereis. you're mixing data layer > and design layer. > > what do yo

[SQL] SELECT max() group by problem

2009-08-02 Thread Heigo Niilop
hi, I have table CREATE TABLE table ( id integer NOT NULL, timest timestamp with time zone NOT NULL, db_time timestamp with time zone NOT NULL DEFAULT now(), "values" text[], CONSTRAINT table_pkey PRIMARY KEY (id, timest) ) „id“ have foreign key with table1 and when I t