QuestionQ63
VerifiedDesign and develop database solutionsYou have an Azure SQL database containing a table named dbo.Customers. The table contains these columns:
CustomerId(int, primary key)ProfileJson(nvarchar(max))
An application returns phone numbers in the format +000 000-000-0000, stored in ProfileJson.
Write a query that returns:
- One row for each customer
- A
PhoneNUmeralscolumn containing only digits
Each value may be used once, multiple times, or not at all.
Drag & Drop
WITH PhoneCTE AS ( SELECT DISTINCT c.CustomerId, AS PhoneRaw FROM dbo.Customers AS c ) SELECT p.CustomerId, AS PhoneNumerals FROM PhoneCTE AS p WHERE IS NOT NULL;
Community Discussion