Columns are
Id int
Timestamp bignit --yyyyMMddhhmmss format
transId char(36) -- guid
type nvarchar(100)
UserId int
I want to find out all those rows for a UserId (Group BY) which has got more than one transactions (transId don’t match) on the same time (timestamp matches) and type in (select typename from typesTable where active =1) and one more filter like the type one.
I tried grouping on userid and timestamp but couldn’t understand how do I add the “don’t match” condition for transId column.
Add this after GROUP BY
or
This will restrict you to different
transIdvalues peruserID, timestampgrouping