- from aps_blank_order a LEFT JOIN (select * from aps_process_operation where DELETED = 0 AND PREVIOUSPROCESSID is null) b ON a.ID = b.BLANKID
+ from aps_blank_order a LEFT JOIN (select * from aps_process_operation where DELETED = 0 AND (PREVIOUSPROCESSID is null OR PREVIOUSPROCESSID = '')) b ON a.ID = b.BLANKID