多表联合查询 实例

SELECT am.`account_id` , am.`related_id` , am.`dept_id` , am.`staff_id` , am.`inout_date` , am.`summary` , am.`ought_money` , am.`derate_money` , am.`inout_money` , am.`haved_money` , am.`handlestaff_id` , am.`note` , si.`staff_id` , si.`name` , ri.`related_id` , ri.`related_name` 
FROM`account_money`AS am
LEFTJOIN staffinfo AS si ON am.`staff_id`= si.`staff_id` 
LEFTJOIN related_company AS ri ON am.`related_id`= ri.`related_id` 
LIMIT 0 , 30

 

posted @ 2014-09-27 13:48  北斗极星  阅读(319)  评论(0编辑  收藏  举报