Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> easy query (?)
I am trying to do what should be a simple query but doesn't seem to
be so in SQL. Can someone give me a hint?
Thanks,
Alice
I would like the final temperature reading for each city at the end of the day.
EX.
City Time Temp Boston 15:00 30 Boston 24:00 10 Phoenix 5:00 70 Phoenix 6:00 72 The resulting set should be Boston 24:00 10 Phoenix 6:00 72
but oracle will now allow you to use
select city, max(temp), time from table
group by city
(as you are now also getting an aggregate of time) Received on Fri Mar 07 1997 - 00:00:00 CST