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

Community
  • 1
  • 1
Hosein Djadidi
  • 198
  • 1
  • 3
  • 13
  • 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. – Collierre Dec 17 '14 at 17:17
  • 1
    This [Link](http://stackoverflow.com/questions/23251506/remove-web-address-from-text-string) which you posted as your same problem is useful if you just run the query twice or thrice – M Zubair Shamshad Dec 17 '14 at 17:56

0 Answers0