Jump to content

problem with having clause...


ricky_vancouver

Recommended Posts

hey everyone,

 

I'm having trouble using the having clause...

 

here's my situation:

 

I have a table of users, and the date they joined...

 

I want data of the users who signed up in the last 7 days before the last user signup...

 

so my sql statement looks something like this:

 

SELECT * from userlist HAVING created_date <= max(created_date) and              created_date >= (max(created_date) - (7 * 24 * 60 * 60))

 

it either returns everything in the table, or nothing...

have be head over heels...

 

thanks for your help... 

Link to comment
https://forums.phpfreaks.com/topic/221472-problem-with-having-clause/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.