Simple Postgresql procedure

Fertiggestellt Veröffentlicht Apr 22, 2009 Bezahlt bei Lieferung
Fertiggestellt Bezahlt bei Lieferung

I've got a PostGresql database. The database contains a Datasets table and an Observations table: ================== CREATE TABLE Datasets ( datasetId SERIAL NOT NULL , name CHAR(10) NOT NULL , startTime TIMESTAMP , endTime TIMESTAMP , PRIMARY KEY (datasetId) ); CREATE TABLE Observations ( observationId SERIAL NOT NULL , time TIMESTAMP NOT NULL , observation VARCHAR(10) NOT NULL , datasetId INTEGER NOT NULL , PRIMARY KEY (observationId) , CONSTRAINT FK_Observations_1 FOREIGN KEY (datasetId) REFERENCES Datasets (datasetId) ); ================== When viewing the list of datasets I want to quickly see the time periods they cover. I believe calculating this afresh each time would be too time consuming. Thus, I'd like a procedure that can be run to populate the 'start time' and 'end time' fields of the parent dataset with the time period covered by child items in that dataset.

## Deliverables

Single PostgresQL query, with instruction on how to load and run it via the PGAdmin III interface.

## Platform

Windows XP

Datenbankverwaltung MySQL SQL

Projekt-ID: #3828002

Über das Projekt

2 Vorschläge Remote Projekt Aktiv Apr 22, 2009

Vergeben an:

tommottom

See private message.

$15 USD in 3 Tagen
(46 Bewertungen)
5.6

2 Freelancer bieten im Durchschnitt $50 für diesen Job

flashandphpgurus

See private message.

$85 USD in 3 Tagen
(6 Bewertungen)
2.9