select to_number(to_char(last_day(to_date('20070802','yyyymmdd')),'dd')) from dual; 其中'20070802'为日期字符串,'yyyymmdd'为日期格式。