- marked as critical
Need mysql query for get particular user mail count.
Hi,
We need mysql query for get particular ldap user mail count from mysql database with particular timestamp.
For Ex: user1@example.com overall archive mail count from 01.05.2023 to 31.05.2023.
Please let us know how to achieve this.
Comments (5)
-
reporter -
repo owner I suggest you to write a query on the v_messages view. It contains both the sender and recipient addresses. First, you need to gather all the email addresses for this user, then run a select using the date range, and be sure to use DISTINCT in the select statement to exclude any duplicate rows.
-
reporter Thanks for your suggestion and i am tried the below mysql query and we got the expected data output.
MariaDB [piler]> SELECT id,
from
,to
FROM v_messages WHERE sent >= 1690828201 AND sent <= 1694456999 ANDfrom
= 'testuser1@example.com';
-
repo owner Great, however, note that this query counts only the emails sent by this user, not what he received.
-
repo owner - changed status to closed
- Log in to comment