SQL Simple -> Convert Character value to Integer

The task is to convert house numbers that are stored in column with character datatype to numeric value. We will use MS-Acces VAL() function that recives char input and returnts Integer as output. Suppose that we have 3 address coumns in table clients: city, street, house. Let's try   VAL() function on house column and see the consequences.


SELECT VAL(house) AS house_number, house, street
FROM clients;


The query returns results like these:
house_numberhousestreet
5151/2trolling str
102102akstrass
0A203/58aufen str
10910 9-Cahen str
0N-8 Apt406ost klapen str
780780 n-19ukitgam 780/19
0--bolken str
1515-H Ap.4via domani


Pay attention that character value "10 9-C" was converted to number 109. On the other hand VAL() function was not able to convert string value "A203/58" to any number but 0.


sqlexamples.info