select *
from (
select * from WEST_EUR_IT.table ta
where 1=1
) WEST_EUR_IT.table
left join(
select a,max(b) from table1 where 1=1
and group by a
)table2 on table."number"=table2."code"
//1、on条件是在生成临时表时使用的条件,它不管on中的条件是否为真,都会返回左边表中的记录。 on、where、having这三个都可以加条件的子句中,on是最先执行,where次之,having最后。