Hi
if i have 2 tables (tbl A, tbl B). Tbl A has 2 columns (account,cash) and it has only one record. Tbl B has 3 columns(account,deposits,transactionCode) as well. They are joined by account and it has 20 records. In my view i wana retrieve everything from tblA which is only one record and from tblb i wana retrieve everything as well but i wana split deposits column into two columns as deposits_one and deposits_two based on transactionCodes but i dont want the cash from tblA to be repeated because i have to sum them at the end. my data is something like this
Sample
tbl A
account cash
123 100
tblb
account deposits trnansactionCode
123 50 5
123 75 10
123 200 5
123 80 10
123 90 5
The result should look something like this
account cash deposits1 deposits2
123 100 340(sum of deposits where code is 5) 155(for code 10)
how do i go about getting something like this. Thanks
if i have 2 tables (tbl A, tbl B). Tbl A has 2 columns (account,cash) and it has only one record. Tbl B has 3 columns(account,deposits,transactionCode) as well. They are joined by account and it has 20 records. In my view i wana retrieve everything from tblA which is only one record and from tblb i wana retrieve everything as well but i wana split deposits column into two columns as deposits_one and deposits_two based on transactionCodes but i dont want the cash from tblA to be repeated because i have to sum them at the end. my data is something like this
Sample
tbl A
account cash
123 100
tblb
account deposits trnansactionCode
123 50 5
123 75 10
123 200 5
123 80 10
123 90 5
The result should look something like this
account cash deposits1 deposits2
123 100 340(sum of deposits where code is 5) 155(for code 10)
how do i go about getting something like this. Thanks