hi can anybody tell me how to combine these two queries

30 pts.
Tags:
Oracle
Oracle queries
Oracle Query
TOAD
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    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.
    69,225 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following