I have a table of names and addresses, which includes a postcode column. I want to strip the spaces from the postcodes and select any that match a particular pattern. I\'m tryin
You can reference is that way if you wrap the query, like this:
SELECT P FROM (SELECT Replace(Postcode, ' ', '') AS P FROM Contacts) innertable WHERE P LIKE 'NW101%'
Be sure to give the wrapped select an alias, even unused (SQL Server doesn't allow it without one IIRC)