[UPHPU] select records with date

Wade Preston Shearer wadeshearer.lists at me.com
Thu Jan 28 02:37:10 MST 2010


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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3392 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20100128/aa02b77c/attachment.bin 


More information about the UPHPU mailing list