General information
Forum:
Microsoft SQL Server
I want to search by using '817145779' into Area table below:
AreaCode
80
801
81
817
8171 --> this is the most accurate pattern
81715
818
82
821
If I run, SELECT * FROM AREA WHERE AREACODE = '817145779' then it will return nothing, because no record match inside 'Area' table, but now what I need is to get the most accurate record pattern in AreaCode field inside the 'Area' table, in this case if I want to search '817145779' then I want it return '8171' because this record is the most accurate record pattern..
any idea?
Thanks a lot in advance
Regards
Winanjaya
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only