sql - Identifying records with double space -
i interested in generating script identify records under 'postcode' column has double space in between instead of single space.
table name: tabu2
cit_id dob status postcode 1 12/84 s kt1 3gp 2 11/81 s kt2 2pi 3 13/80 m kt1 2pp 4 15/78 m kt3 2on 5 13/67 m kt5 4ii
many thanks
select * tabu2 postcode '% %'
or
select * tabu2 charindex(' ',postcode)>0
to fix
update tabu2 set postcode=replace(postcode,' ',' ') charindex(' ',postcode)>0
Comments
Post a Comment