Home » SQL & PL/SQL » SQL & PL/SQL » finding max(seq_no) based on counter_reading.
finding max(seq_no) based on counter_reading. [message #20950] Tue, 02 July 2002 16:25 Go to next message
Ravi pampana
Messages: 2
Registered: July 2002
Junior Member
Hi,
For this data

Seqno Counter_reading
----- ---------------
2 10
3 25
5 123456
4 7022202

I need to get the most recent value of counter_reading based on seqno.Reason is the counter_reading may be reset to '0' sometimes.

Here for seqno 5 the counter value 123456 is the current reading noted.

You help would be highly appreciated

Thanks
Ravi.
Re: finding max(seq_no) based on counter_reading. [message #20953 is a reply to message #20950] Tue, 02 July 2002 18:02 Go to previous message
Gopal
Messages: 23
Registered: June 1999
Junior Member
Select counter_reading
from tablea where
seqno = ( select max( seqno ) from tablea );

Thanks
Gopal
Previous Topic: select query help
Next Topic: speed query,urgent
Goto Forum:
  


Current Time: Fri Apr 26 09:12:57 CDT 2024