Shishant Shishant - 2 months ago 21
C# Question

How to find candian postal code between low and High by SQL Server or c#

I just want to know how to find Canada or UK postal between low and High Postal code.

For Example: Low postal code:

A0A0A0
and High is:
A0Z9Z9


How to find postal code between these postal
A0A0A0
and
A0Z9Z9
?

Answer

You can use LIKE pattern matching

WHERE Code LIKE 'A0[A-Z][0-9][A-Z][0-9]'