I'm having difficulty getting only the zip code of a field in which the address data is not atomic, I'd like to know a way using MySQL to get only the 8 numeric values of the ZIP code from the field of all records in the database which contain 8 successive digits and if possible considering the cases where there is a hyphen (-) but only bringing numbers as a result of the selection.
Typical values in the table of interest field: (address field data)
BR-50670901 Recife, PE, Brazil.
BR-70910900 Brasilia, DF, Brazil.
BR-14040901 Ribeirao Preto, SP, Brazil.
BR-74001970 Goiania, Go, Brazil.
Nucleo Fis Aplicada, BR-70919970 Brasilia, DF, Brazil.
F-35042 Rennes, France.
Dept Matemat, BR-13083970 Campinas, SP, Brazil.
Rochester, NY 14627 USA.
Cambridge CB3 9EW, England.