I've tried 50 different variations and still get the same result. I want to query the _Open table on ET's servers and return all unique events for a subscriber. When I go into the triggered event tracking, there are multiple records for the same subscriber, but when I query the _Open table, I always get a single record back.
Triggered Event Table:
+-------------------------------+-------------------------------+--------------------+
| SubscriberKey | Email | OpenTime |
+-------------------------------+-------------------------------+--------------------+
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/9/2015 2:20 PM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/9/2015 2:41 PM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/12/2015 6:48 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/12/2015 6:48 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/15/2015 5:33 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/15/2015 5:33 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/15/2015 5:56 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/15/2015 5:56 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/15/2015 6:02 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/15/2015 6:02 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/15/2015 7:39 AM |
| ExactTargetSupport@client.com | ExactTargetSupport@client.com | 10/16/2015 6:00 AM |
+-------------------------------+-------------------------------+--------------------+
My query:
SELECT DISTINCT(TriggeredSendCustomerKey),
SubscriberKey, JobID, EventDate
FROM _Open
Where TriggeredSendCustomerKey = 'Trigger_Name'
OR TriggeredSendCustomerKey = 'Trigger_Name_B'
What returns:
+-------------------------------+--------------------------+--------+--------------------+
| SubscriberKey | TriggeredSendCustomerKey | JobID | EventDate |
+-------------------------------+--------------------------+--------+--------------------+
| ExactTargetSupport@client.com | Trigger-Name | 900353 | 10/16/2015 6:00 AM |
+-------------------------------+--------------------------+--------+--------------------+
Best Answer
SoQL does not have distinct, so I am assuming you are using SQL. If you want to code it into SoQL then the samples above help.
If you are trying to run a DISTINCT query in sql (not SOQL), then you can't select all the fields like you're doing. Try the below query, I think those parenthesis might be hurting you.