I have a have a column which is set as character but users can insert numbers.
How can I identify when the field has numbers length 11 and not letters?
Example:
sample data {col1= aaaaaaaaaaa,11111122222}
select Col1
from
table
group by 1
having SUM(CHARACTER_LENGTH(Col1))=11
wrong output: aaaaaaaaaa
desired output: 11111122222
In short, I need to retrieve all values in the char column that could be identified as numbers and having 11 digits.