I've been waiting for this request for more than an hour, so I know that I'm probably doing something wrong. Is there an efficient way to customize this query :?
select RespondentID, MIN(SessionID) as 'SID' from BIG_Sessions (nolock) where RespondentID in ( 1418283, 1419863, 1421188, 1422101, 1431384, 1435526, 1437284, 1441394, 1579244 ) and EntryDate between '07-11-2011' and '07-31-2012' GROUP BY RespondentID
I know that my date range is quite large, but I canβt change this part (dates are spreading all over the place).
Also, the reason for MIN(SessionID) is that otherwise we get a lot of SessionID for each respondent, and enough (it takes MIN on an alphanumeric identifier like ach2a23a-adhsdx123 ... and gets the first alphabet)
thanks
source share