select A.id,B.trader_id,A.type from ((select id,type from account_account where type != 0) as A left join account_account_trader as B on A.id = B.account_id)