problem with a query

From: "Carlos Sousa" <carlosdsousa(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: problem with a query
Date: 2002-10-23 14:05:50
Message-ID: F94LAPDVXLuSbh29cM300000459@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

hi to all

i need to do a query to a small postgres database
my best efort to the pretended query is in the attached file 'query.txt'
but i need that some rows don't be selected of thouse that the query
returns.

i send in another attached file 'result.txt' with the query result. looking
at content of the file you will see some notes at the end of the table (#..)

the database as the data to enable the constrution of a school class
schedule.

In the 'result.txt' all the rows with max=0 were the fisrt to be inserted do
the database. each row represent as example math pratical starting at 8:30
for 1:30 at room 3.15 in the bilding CP

the rows with max!=0 (1,2,3,...) mean that content of an insert with max=0
was changed [ex diferent time (fiel to_char) or room (field sala) or bilding
(field edificio)of the school class]. row with max=1 is a substitution to a
row with max=0, row with max=2 substitutes row with max=1 and ...

my objective is to obtain all the rows that were not substituted and the
ones that represent the last alteration to the shedule

i hope the problem was understod
thanks for your time

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

Attachment Content-Type Size
query.txt application/octet-stream 720 bytes
result.txt application/octet-stream 4.2 KB

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-10-23 14:25:53 Re: sub-select with aggregate
Previous Message Tomasz Myrta 2002-10-23 14:02:58 Re: sub-select with aggregate