I have a difficult MySQL query to write. Is there anyone that can assist?

I have a users table. I have another table with things the user does.

I need to select all the things the user has done within the current three year window since the date the user's account was created.


Example:

So, if the user's account was created in Feb 2001, they did something in Mar 2003, something in Nov 2009, and something else in Jan 2010, the query would return 2 records, because they did…

.       one thing in the first three years
.       nothing in the second three years
.       and two things in the third (current) three year period


…and we only want the things that were done within the current three year period.


Is that possible in a single query?

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to