| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Dan Nelson | Date: | May 12 2011 6:06pm |
| Subject: | Re: operation with dates | ||
| View as plain text | |||
In the last episode (May 12), Rocio Gomez Escribano said: > I found it, > > mysql> select userID from user where datediff(now(), userPaymentDate)< 365; This can be made more readable by using mysql's INTERVAL syntax. It can also be made more efficient by moving userPaymentDate out of the function, so if you have an index on that column mysql can use it: select userID from user where userPaymentDate > (now() - interval 1 year) -- Dan Nelson dnelson@stripped
| Thread | ||
|---|---|---|
| • operation with dates | Rocio Gomez Escribano | 12 May |
| • Re: operation with dates | Andrew Moore | 12 May |
| • RE: operation with dates | Rocio Gomez Escribano | 12 May |
| • Re: operation with dates | Dan Nelson | 12 May |
| • Re: operation with dates | hsv | 13 May |
| • Re: operation with dates | Dan Nelson | 13 May |
| • Re: operation with dates | hsv | 14 May |
