Simple Postgresql procedure
$30-100 USD
Pago na entrega
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
ID do Projeto: #3828002