Problem searching a field with SQL query LIKE ('%%')
Hi,
I have a table, with a `Size` field, I would like to search through each entry on this field and display shoes with only the size searched..
An example of the field data would be this:-
'36,37,38,39,40,41,42'
They are shoe sizes.
I use UK and EU sizing on the site so sometimes it looks like this:-
'3,4,5,6,7,8'
The problem I have is when I use this SQL statement to get back search results:- (for example searching for size 3)
Code:
SELECT DISTINCT `ID`
FROM `the_table_in_question`
WHERE `Size` LIKE ('%3%')
It returns everything with a 3 in it.. which is what Ive asked of it.
So the question; is there a way through SQL to show results containing a 3, but not display the ones that are 36, 37, 38 and 39
Thanks for your time.
Best Regards,
Pete