insert into aa (id,name) values((select case when max(id) is null then 1 else max(id)+1 end from aa),'a');