您需要将条件同时放在子查询和外部查询中:
select yt1.*from yourtable yt1 left outer join yourtable yt2 on yt1.id = yt2.id and yt1.val < yt2.val and yt2.ignore <> 1where yt2.id is null and yt1.ignore <> 1;

您需要将条件同时放在子查询和外部查询中:
select yt1.*from yourtable yt1 left outer join yourtable yt2 on yt1.id = yt2.id and yt1.val < yt2.val and yt2.ignore <> 1where yt2.id is null and yt1.ignore <> 1;