mysql - Converting outer join from Sybase to My Sql -
can me converting joins in sql..
select distinct b.gl_acct_type + '0', b.gl_id, b.fd_id, b.gl_sub, b.gl_tran, b.gl_entry_type, isnull(b1.gl_amount,0), isnull(b2.gl_amount,0), isnull(b3.gl_amount,0), isnull(b4.gl_amount,0), isnull(b1.gl_debit,0), isnull(b2.gl_debit,0), isnull(b3.gl_debit,0), isnull(b4.gl_debit,0), isnull(b1.gl_credit,0), isnull(b2.gl_credit,0), isnull(b3.gl_credit,0), isnull(b4.gl_credit,0), b.detail_yn zz_cfs_bal_1 b, zz_cfs_bal_2 b1, zz_cfs_bal_2 b2, zz_cfs_bal_2 b3, zz_cfs_bal_2 b4 b.gl_acct_type in ('1', '2', '3') , b.gl_id *= b1.gl_id , b.fd_id *= b1.fd_id , b.gl_entry_type *= b1.gl_entry_type , b1.line_type=1 , b.gl_sub *= b1.gl_sub , b.gl_id *= b2.gl_id , b.fd_id *= b2.fd_id , b.gl_entry_type *= b2.gl_entry_type , b2.line_type=2 , b.gl_sub *= b2.gl_sub , b.gl_id *= b3.gl_id , b.fd_id *= b3.fd_id , b.gl_entry_type *= b3.gl_entry_type , b3.line_type=3 , b.gl_sub *= b3.gl_sub , b.gl_id *= b4.gl_id , b.fd_id *= b4.fd_id , b.gl_entry_type *= b4.gl_entry_type , b4.line_type=4 , b.gl_sub *= b4.gl_sub
thanks in advance
select distinct b.gl_acct_type + '0', b.gl_id, b.fd_id, b.gl_sub, b.gl_tran, b.gl_entry_type, ifnull(b1.gl_amount,0), ifnull(b2.gl_amount,0), ifnull(b3.gl_amount,0), ifnull(b4.gl_amount,0), ifnull(b1.gl_debit,0), ifnull(b2.gl_debit,0), ifnull(b3.gl_debit,0), ifnull(b4.gl_debit,0), ifnull(b1.gl_credit,0), ifnull(b2.gl_credit,0), ifnull(b3.gl_credit,0), ifnull(b4.gl_credit,0), b.detail_yn zz_cfs_bal_1 b, zz_cfs_bal_2 b1, zz_cfs_bal_2 b2, zz_cfs_bal_2 b3, zz_cfs_bal_2 b4 b.gl_acct_type in ('1', '2', '3') , b.gl_id *= b1.gl_id , b.fd_id *= b1.fd_id , b.gl_entry_type *= b1.gl_entry_type , b1.line_type=1 , b.gl_sub *= b1.gl_sub , b.gl_id *= b2.gl_id , b.fd_id *= b2.fd_id , b.gl_entry_type *= b2.gl_entry_type , b2.line_type=2 , b.gl_sub *= b2.gl_sub , b.gl_id *= b3.gl_id , b.fd_id *= b3.fd_id , b.gl_entry_type *= b3.gl_entry_type , b3.line_type=3 , b.gl_sub *= b3.gl_sub , b.gl_id *= b4.gl_id , b.fd_id *= b4.fd_id , b.gl_entry_type *= b4.gl_entry_type , b4.line_type=4 , b.gl_sub *= b4.gl_sub
Comments
Post a Comment