Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

TSQL Challenge 54 - Find the longest matching area code

By Jacob Sebastian,

TSQL Challenge 54 - Find the longest matching area code from phone numbers

An IVR application stores call information into a SQL Server table. A reporting application needs to read phone numbers from the call log and identify the country-code/area-code that is part of the phone number. Your job is to write a query that identifies the longest matching country/area code from each phone number based on the information stored in an area-code reference table.

http://beyondrelational.com/blogs/tc/archive/2011/04/18/tsql-challenge-54-find-the-longest-matching-area-code-from-phone-numbers.aspx

Total article views: 1151 | Views in the last 30 days: 4
 
Related Articles
SCRIPT

Format Phone Number function

Function to format phone numbers entered as text.

FORUM

Clean international Phone Numbers

Gotta clean up phone numbers as I load into SQL and it is a mess!

FORUM

Phone number formatting

Phone number formatting

FORUM

Random Phone numbers

Can anyone help me generate a statement that will update a table with random phone numbers with the ...

FORUM

how i could take the longest no match??

how i could take the longest no match??

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones