語句
SELECT a.id as item_id,a.name as item_name,a.intro as item_intro,b.id,b.money FROM sh_incentive_item a left join ( SELECT * FROM `sh_incentive` WHERE ( `agent_id` = 3 ) AND ( `year` = 2016 ) AND ( `month` = 1 ) ) b on a.id = b.item_id;
如何實作
SELECT * FROM `sh_incentive` WHERE ( `agent_id` = 3 ) AND ( `year` = 2016 ) AND ( `month` = 1 );
<a></a>
整體