MY FIRST POST may not have been clear, but I can't edit it. I am looking to identify users already in my database that have more then one payment record within a 24 hour time period.
Hi Barand - thank you for the reply! I am a newbie - but I think I am not understanding your reply. I have altered my SQL (incorporating what I think you were implying) - as your exact SQL produced no results:
SELECT DATE(payments.date) as date, users.username, COUNT(*) as tot from payments INNER JOIN users ON payments.user_id = users.id WHERE (payments.membership_id = 7 or payments.membership_id = 6) GROUP BY payments.user_id, date HAVING tot > 1
Produced no results. If I remove the HAVING clause, I get exactly what I had with a tot column that has '1' in every cell.
I didn't see anything in your SQL that deciphered records within 24 hours from those outside 24 hours apart for the same user. I am a newbie, so I assume I am missing something you were trying to get me to do.
Benanamen - I am looking for a way to identify those who have already signed up, not preventing future ones. But thank you for the reply.