Karem
Karem

Reputation: 18103

Look for a number in a column with multiple numbers

Following from this: Every specific weekday, sql and php

I got this:

deals_bookings.everyWeekDay = DAYOFWEEK(CURDATE())

Works great if there's a single value like: 1 in it.

But everyWeekDay column can contain more numbers, in a format like this: 1,2,3,4

So i would like to look for DAYOFWEEK(CURDATE()) number in this.

How can it be done?

Upvotes: 1

Views: 54

Answers (1)

Sebas
Sebas

Reputation: 21522

FIND_IN_SET(DAYOFWEEK(CURDATE()), deals_bookings.everyWeekDay) > 0

Upvotes: 2

Related Questions