SQL statement needed for an ORACLE db - I use SQL developer
£10-20 GBP
In Progress
Posted over 6 years ago
£10-20 GBP
Paid on delivery
I need a SQL statement written for an ORACLE db - I use SQL developer.
Hi all,
I need SQL to compare the below 2 sub queries and then only show values that are different in the 'latest' (subquery2) subquery. Both subqueries use the same table to SELECT FROM:
**Subquery 1:**
select tra_rac_accno, tra_cr
from transactions
join admin_periods on trunc(sysdate-7) between ape_start_date and ape_end_date
and ape_admin_period_type = 'BAL'
and ape_aye_aun_code = 'CANTERBURYW'
and tra_date between ape_start_date and ape_end_Date
where tra_trt_code = 'HBS'
and tra_rac_accno not in ('2')
order by tra_rac_accno ASC
**Subquery 2:**
select tra_rac_accno, tra_cr
from transactions
join admin_periods on trunc(sysdate) between ape_start_date and ape_end_date
and ape_admin_period_type = 'BAL'
and ape_aye_aun_code = 'CANTERBURYW'
and tra_date between ape_start_date and ape_end_Date
where tra_trt_code = 'HBS'
and tra_rac_accno not in ('2')
order by tra_rac_accno ASC
Subquery 1 Output:
**tra_rac_accno tra_cr**
318 66.7
323 97.67
328 107.26
336 96.95
340 80.14
Subquery 2 Output:
**tra_rac_accno tra_cr**
318 69.5
323 97.67
328 107.26
336 96.95
340 50.20
I want to see the following output:
**tra_rac_accno tra_cr**
318 69.5
340 50.20
I appreciate all who take time to read this post and also respond with assistance. THANK YOU!
I have checked detail your requirements and ready to start right now. I am available with Skype, Gtalk and phone. waiting for reply.
Relevant Skills and Experience
i have a experience in sql and oracle also
Stay tuned, I'm still working on this proposal.