select a.* from
(
select fa_order ma, fl_id from t_Flowaudit where us_id=98
) as a,
(
select max(fa_order) ma,fl_id from t_Flowaudit group by fl_id
) as b
where a.ma=b.ma and a.fl_id=b.fl_id
(
select fa_order ma, fl_id from t_Flowaudit where us_id=98
) as a,
(
select max(fa_order) ma,fl_id from t_Flowaudit group by fl_id
) as b
where a.ma=b.ma and a.fl_id=b.fl_id
(
select fa_order ma, fl_id from t_Flowaudit where us_id=98
) as a
where exists (
select 1 from
(
select max(fa_order) ma,fl_id from t_Flowaudit group by fl_id
) as b
where a.ma=b.ma and a.fl_id=b.fl_id
)
select fa_order ma, fl_id from t_Flowaudit where us_id=98 and exists (
select max(fa_order) ma,fl_id from t_Flowaudit t1 where t1.ma = t_Flowaudit.ma and t1.fl_id = t_Flowaudit.flid group by fl_id )