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!

Simple Issue: Timestamp to Date

983389Jan 7 2013 — edited Jan 7 2013
Hello...
I have thousands of transactions per day with corresponding timestamps associated with each. I am trying to show total sales by day. I tried to combine all the timestamps and sum up the subtotals for the purchases using the following query:


select TO_char (t.transaction_date, 'MON-DD-YYYY') AS Transaction_Date, c.name as Name, t.subtotal
from scecomm_ods.s_sce_transaction t, scecomm_ods.s_sce_country c
where t.country_code = c.country_code
group by t.transaction_date, c.name, t.subtotal

The problem is that I see multiple date records for the same day. For example I see 4 records for March 15th, 2012 for United States with different subtotal values. What change should I make so I only see one row for each country will the combined subtotal?

Thank you.

A bit dazed...a bit confused.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2013
Added on Jan 7 2013
1 comment
219 views