How can I update many rows with SQL in a single table?

Posted by tmarouda on Stack Overflow See other posts from Stack Overflow or by tmarouda
Published on 2010-04-11T10:43:04Z Indexed on 2010/04/11 10:53 UTC
Read the original article Hit count: 209

Filed under:
|
|

Hi folks.

I have a table and one of the columns holds web addresses like: 'http://...' or 'https://...'.

The problem is that there are some invalid entries, like 'shttp://...' or '#http//...' (the first character is invalid) and I want to correct all of them.

I use the following SQL statement:

'SELECT [...] FROM MyTable WHERE WebAddress LIKE '_http%'

and I successfuly get the problematic rows.

But how am I going to change/correct all of them using an UPDATE statement? If you have some other solution please share it!

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server