Basically I've extracted all the streets for London which has over 500000+ records. The database is using SQL Server 2008. For some streets it has put them in correctly such as 'ABBEY TERRACE' and 'ABBEY VIEW', but for others like 'ABBEY STREET' it has got many duplicated entries of similiar postcodes.
What I would like to do is keep the first 'ABBEY STREET' (SE1 2AN) and 'ABBEY STREET' (SE1 3BU) but remove the other entries. So basically it is looking at the '5th' character and removing the duplicates.
I indexed this so that it removed all of them for the '6th' character which works for postcodes that start with W1 1AA, but not ones that start with W11 1AA.
Is there any way I can remove the duplicats via SQL for postcodes that start with three characters?
Table : Locals
Index Street PC
371582 ABBEY STREET SE1 2AN
371583 ABBEY STREET SE1 2DP
371584 ABBEY STREET SE1 3BU
371585 ABBEY STREET SE1 3DW
371586 ABBEY STREET SE1 3ED
371588 ABBEY STREET SE1 3NJ
371589 ABBEY TERRACE SE2 9EY
371590 ABBEY VIEW NW7 4PB