2

lets say I have a table which names is mytable and it only has one column, the content of each row is a text that may contain URL:

Row 1 some text http://t.co/ibcvfpZFf4 
Row 2 some text 
Row 3 some text http://t.co/exU5lmGrY9 some text 2 http://t.co/oXFQODFNja
Row 4 some text  http://t.co/7LQGHHSVzQ some text 2 http://t.co/DEVzWIKhLn some text 3 http://t.co/dl6aB76SNV some text 4 

Assume :

  • There are different URLs
  • some rows are contain up to 3 URLs
  • I am using Microsoft SQL server

I am looking for an update query to give me the result below :

Row 1 some text  
Row 2 some text 
Row 3 some text some text 2 
Row 4 some text some text 2 some text 3 some text 4

I found a similar problem here but its just work for a single URL

2
  • Is it necessary to do it with SQL? It would be simpler to dump the table, apply a regex such as http:\/\/\S* and remove everything found, then reimport the table. Commented Dec 17, 2014 at 17:17
  • 1
    This Link which you posted as your same problem is useful if you just run the query twice or thrice Commented Dec 17, 2014 at 17:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.