issue with JOIN three tables with an alias for the same column
===

I have two tables: 
1. date_info with the columns:- date_id,year
2. transactions with the columns:- date_id, amount, trx_type.

trx_type only can be 'credit' or 'debit'

What I need to display is the year, credit and debit as results. (if trx_type is debit should be called debit vise versa).

I can get one of them using the following. BUT can't JOIN it to get both values.

select * from date_info as dt INNER JOIN (select date_id,amount as debit from transaction where tx_type = 'debit') as db on dt.date_id = db.date_id; 

Can you please help me....
