This challenge involves counting the number of occurrences of HTML tags in a given list of strings. You can assume that there will be only valid HTML tags in the input strings. The output should display tags in ascending order. Sample Input DataID HtmlText
-- -------------------------------------------------------------------------
1 <Html><Body><Font>This is challenge #18</Font><Font></Font></Body></Html>
Expected OutputID TagNamesOccurance
-- -----------------------------------------------------------------
1 Body(Found: 1 time), Font(Found: 2 times), Html(Found: 1 time)ScriptDECLARE @t TABLE(ID INT IDENTITY, HtmlText VARCHAR(Max))
INSERT INTO @t(HtmlText)
SELECT '<Html><Body><Font>This is challenge #18</Font><Font></Font></Body></Html>'
SELECT * FROM @t
Read more: Beyond Relational
-- -------------------------------------------------------------------------
1 <Html><Body><Font>This is challenge #18</Font><Font></Font></Body></Html>
Expected OutputID TagNamesOccurance
-- -----------------------------------------------------------------
1 Body(Found: 1 time), Font(Found: 2 times), Html(Found: 1 time)ScriptDECLARE @t TABLE(ID INT IDENTITY, HtmlText VARCHAR(Max))
INSERT INTO @t(HtmlText)
SELECT '<Html><Body><Font>This is challenge #18</Font><Font></Font></Body></Html>'
SELECT * FROM @t
Read more: Beyond Relational
0 comments:
Post a Comment