Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
MySQL LIKE condition bysonary
hey i have a question is it possible to combin the LIKE feature of mysql to construct a query that would be like this.
select * from table WHERE field LIKE 'chris' AND NOT LIKE 'chriostopher'
if you can could someone please tell me how?
You can combine LIKE in queries
select * from table WHERE field LIKE 'chris%' AND field NOT LIKE 'christopher%'
The above query will return every name beginning 'chris' but will not return names beginning 'christopher'
(I assumed you made a typo in your example with 'chriostopher')
yes i did make a typo, thats great, so you could i use this with numbers for example if a number field contains the number 1555 and 1556 if i exclude the 1556 will i get all of the records with 1555 in the field? barns101