1. SELECT count(*) AS Cnt1 FROM tsau_pre_msges WHERE ( (EXTRACT (DAY FROM Jms_timestamp)-EXTRACT (DAY FROM ins_time))*24*60 + (EXTRACT (HOUR FROM Jms_timestamp)-EXTRACT (HOUR FROM ins_time))*60 + EXTRACT (MINUTE FROM Jms_timestamp)-EXTRACT (MINUTE FROM ins_time) ) BETWEEN 1 AND 5
It will count messages from total in the next query it vl give percentage from count value to total messages
2.select tot*100 total from(select Cnt1/t tot from (select max(Cnt1) t from tsau_pre_msges ), tsau_pre_msges ) so that i get output as
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!