D
D
Dmitry Tarasov2020-07-06 17:17:18
MySQL
Dmitry Tarasov, 2020-07-06 17:17:18

How to display all records that are older than 6 months mysql?

Hello!
Is it possible to do this at all?
It works somehow strange, in the month field I have an enum there and all records have 6.
For some reason, it takes not 6 months, but 3, how is this possible?
I put the number 6 instead of the field and it works fine.
mysql 8

`unixtime` < NOW() - INTERVAL `month` MONTH

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2020-07-06
@fast-je

If you have ENUM there, then the value of the field is not what you see on the screen, but the ordinal number of this option in ENUM.
That is, for ENUM('1', '3', '6') one will give a numerical value of 1, three - 2, six - 3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question