LEFT JOIN on 后面接 and 条件
例 : LEFT JOIN OA_FLOW of on fa.FLOW_ID = of.ID and of.STATE = '0' ;
和
通过where接条件的区别
例 : LEFT JOIN OA_FLOW of on fa.FLOW_ID = of.ID where of.STATE = '0';
sql一、
SELECT
fa.ID,fa.APPLY_ID ,of.FLOW_NAME,of.CREATE_TIME
from FLOW_APPLY fa
LEFTJOIN OA_FLOW ofon fa.FLOW_ID =of.ID
andof.STATE ='0';
下面为查询结果
sql二、
SELECT
fa.ID,fa.APPLY_ID ,of.FLOW_NAME,of.CREATE_TIME
from FLOW_APPLY fa
LEFTJOIN OA_FLOW ofon fa.FLOW_ID =of.ID
whereof.STATE ='0';
下面为查询结果