I have table called Empdetails. Here one of column name is loginid. I want to replace loginid if it contain @s.com, in few case it has.
Loginid
[email protected]
sdf
ghj
[email protected]
[email protected]
[email protected]
update Empdetails
set loginid = REPLACE(loginid, '@s.com', '')
where id in (1,6,8,9)
If I mistakenly mention id whose loginid does not contain any '@s.com', will throw an error. Is above query is fine
AND loginid LIKE '%@s.com%'to the WHERE clause to keep transaction size down.