How do I create a query that uses the value from another table as a WHERE LIKE clause?
For example I have a POSTCODE table consisting of postcode values such as 'DD', 'L', 'WN', etc... But how can I run a query on another table, say CUSTOMERS, by pulling out like values from the postcode one?
If it was hard coded it would read something like:
select * from CUSTOMERS where CUSTOMERS.POSTCODE like 'DD%' or CUSTOMERS.POSTCODE like 'L%' or CUSTOMERS.POSTCODE like 'WN%'
So far I have created a cursor however I am unsure how to get the like postcode values restrict on LIKE.