For example, there is a table type of meetings, it has a numeric field "time for which an event can be overdue," in minutes. There is a table of events where there is a period of events. How to select events that have expired by more than "time _..."
SELECT * FROM crmTasks WHERE ( date(crmTaskDueDate) < date_add(curdate(), INTERVAL - **crmTaskTypeNormaTimeMin** MIN) )
This design does not work ...
curdate() - INTERVAL ...
? And try to make queries so as not to apply the function to the table column, i.e. what would be just crmTaskDueDate, and not date () from it. You force the optimizer to do a full table scan using the optimizer function, even if you have an index on the date column - Mike