I want to count number between say 56,80,95 and 108 from a column of my table where i have stored digits seperated with a ",". Now, I want to count the primary id's of the columns which contains any of the above number using like or some other way. I tried using like as below:
SELECT COUNT(DISTINCT(ID)) FROM TABLE_NAME WHERE COL_NAME LIKE "%56%" OR '%80%'
SELECT COUNT(DISTINCT(ID)) FROM TABLE_NAME WHERE COL_NAME LIKE ("%56%" OR '%80%')
NON OF THIS WORKS
NON OF THIS WORKS--- BREAKING NEWS!!!select "%56%" OR '%80%'. You'll see it's zero (boolean false). The LIKE operator expects a string, not a boolean.