Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

get previous from max value

Adeel AslamMar 13 2012 — edited Mar 13 2012
I have folowing sql query an di want to get previous of max value from table.


select max(card_no),vehicle_number
FROM WBG.WBG_01_01
group by vehicle_number

Through this query i got each maximum card number of each vehicle.But i want to get previouse of that max.For example

if vehicle number has card number 21,19,17,10,5,6,1 and i want to get 19 from max function

Please anyone tell me how can i do this in sql.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2012
Added on Mar 13 2012
5 comments
1,084 views