pro sql number;
create table daily_total as
select distinct trans_dt,
sum((select (quantity * unit_price)
from transaction_detail
where subcat_num = 1111 and trans_dt = a.trans_dt))
from transaction_detail as a
where trans_dt between '2015-01-01' and '2015-01-02';
quit;
I understand I can achieve the samething with group by but I want to do this by subquery for the learning experierence.
I essentially want to select the two distinct dates and return the sum of each individual transaction for the subcategory on that particular day.
Thank you.