How to check day of the week being 1,3,5

Asked

Viewed 43 times

-1

Galley,

I have a field in my table that keeps the day of the month, example

But in this very field I’m recording the information like this: 1,2,3,5,22

Today is day 22 DAY( NOW( ) = 22

See that in my field the day is 1,3,5 as today is 22 should bring the record.

How can I check my field in mysql? Split? If so, how can I use?

1 answer

4

Use the like

SELECT * FROM tabela WHERE campo LIKE "%5%"
  • I’m sorry, I just gave the example of the day of the WEEK, but I need the day of the MONTH too. So the like does not solve.

  • So your question is very confused. Because the way it is, the like would work. Explain better.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.