I have a table per_all_people_f with 3000-4000 person numbers. A few non-numeric characters are also there in some cases. I want to pick the highest number present in this table. When I am using the below query :
select ( MAX ( DISTINCT person_number) ) from per_all_people_f
where REGEXP_LIKE(person_number , '^[[:digit:]]+$')
I am not getting the maximum number. I am getting 98098 although much bigger numbers like -1503388 already exist in the system.
How can I change the above query to get the maximum "Number" in this column.
distinctdoesn't really make sense together withmax()