oracle - SQL JOINS AND GROUPING -
below tables input tables need joined prepare desired output.
accts:
acctno branchcode 501000524165 100 501000524220 101 501000524275 102 501000524330 103 501000524385 104 501000524440 105 501000524495 106 501000524550 107 501000524605 108 501000524660 109 501000524715 100 501000524770 101
transaction:
trans_id trans_amt acctno 1 2500 501000524165 2 5000 501000524220 3 7500 501000524275 4 10000 501000524330 5 12500 501000524385 6 15000 501000524440
branches:
branch_code branch_name branch_phone 100 bangalore 1234567890 101 chennai 2345678901 102 hyderabad 345678901 103 trivendram 4567890123 104 kochi 56789012 105 bhubanes 6789012345 106 mumbai 7890123456 107 kolkata 890124567 108 mysore 901245678
i need output this
branchname branchphone transaction_amt
using regular join
between tables can required output.
select b.branch_name, b.branch_phone, t.trans_amt branches b join accts on b.branch_code = a.branch_code join transactions t on a.acct_no = t.acct_no
output
branch_name branch_phone trans_amt ----------- ------------ ----------- bangalore 1234567890 2500 chennai 2345678901 5000 hyderabad 345678901 7500 trivendram 4567890123 10000 kochi 56789012 12500 bhubanes 6789012345 15000
Comments
Post a Comment