MySQL Forums
Forum List  »  Newbie

Re: How to check if `Pcode` from the table is in the string 'AB134DE'
Posted by: Jason Carroll
Date: September 16, 2014 10:50AM

Ah thats a possibility, I remember something about this.

I just tried...

SELECT `Pcode` FROM `postcodes` WHERE concat(`Pcode`, '%') LIKE 'AB134DE'
but nothing was returned. my table has the following entry that relates to the string 'AB134DE'...

AB13

strange that it did not return this result.

just before I was about to post I realised what was wrong...

SELECT `Pcode` FROM `postcodes` WHERE 'AB13' LIKE concat(`Pcode`, '%')
works just as expected.

Thank you Peter Brawley

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.