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
example:40 20%,
plse help me out thnx advance
Software/Hardware used:
toad 9.5
ASKED:
July 26, 2010 11:32 AM
UPDATED:
July 26, 2010 6:20 PM
I’m not sure I understand.
Does your tsau_pre_msges table have a field called ‘Cnt1′ ? (you are using Cnt1 as an alias for your count in the first query, but you are also using it as a field in your second query).
Also, your first query returns just 1 row, but the second one returns many rows. How exactly do you want to combine them ?
Additionally, the database version is more important than the Toad version used to connect to the database.