This was one possible solution that a friend very familiar with
PostgreSQL ( the target db in this question btw) came up with. I repeat it
here just for informational purposes.
select s.id, s.date, s.price from stock s,
(select id, min(price) as price from stock group by id) as m
where s.id = m.id and s.price = m.price
and s.date = (select max(x.date) from stock x
where x.price = m.price and x.id = m.id);
Eric:
I really don't understand your solution, could you give me the plain english desrciption of what its doing?
Thanks Mike
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only