zzwyb89
zzwyb89

Reputation: 470

Select part of a string in a column

I have a query, and I am filtering out results by providing the query with information. I have the basic SELECT and then I have:

AND db_schedules.daysofweek = '0'";

However, this searches for the presence of 0 on it's own in the daysofweek column. How can I tell it to look for it in the string and not on it's own? Like if the column is something like 1340, then the query will return that record in the search result, because the query found a 0 in the string.

Upvotes: 0

Views: 181

Answers (1)

sgeddes
sgeddes

Reputation: 62831

Just use LIKE:

AND db_schedules.daysofweek LIKE '%0%'";

Upvotes: 1

Related Questions