Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

Oracle - Search with postal code have a specific format

Hi

I would like to know how i can search in an oracle table where the postal code format is 3 digits & " " & 3 gits

SELECT POSTAL_CODE
FROM LOCATION
where POSTAL_CODE format =  LEFT(POSTAL_CODE, 3) + '  ' + RIGHT(POSTAL_CODE, 3 );

How can i do that?
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
btw: LEFT is a SQL Server function! The equivalent in Oracle would be SUBSTR ;-)
Whatsoever, slightwv's solution is the correct way :-))
Avatar of Wilder1626

ASKER

Thanks. This is exactly what i needed.