I'm trying to select only the User_IDs
that are in the first select statement and the last select statement, but I am doing something wrong.
SELECT COUNT(DISTINCT User_ID) AS total
FROM UserClicks
WHERE (Date > :startDate AND Date < :endDate)
AND User_ID IN (
SELECT User_ID
FROM UserClicks
WHERE (Date > :monthBeforeStartDate AND Date < :startDate)
)
Update: This is for a MySQL database.