to_char(state_date,'yyyymmdd')<
(select max(to_char(state_date,'yyyymmdd')) from serv_product where product_id=301032 
and state not in ('H0A','H1X') );日期可以直接比较,转换成字符型反倒容易出错
改一下:
state_date )<
(select max(state_date) from serv_product 
where product_id=301032 and state not in ('H0A','H1X') );