I'm having troubles with
Select TCODE, Tcount, Userid, TTEXT
Group by Tcode,tcount, userid, ttext
GROUP BY TCODE
TCODE TCOUNT USERID TTEXT
SESS 13 USER-001
SESS 8 USER-003
SESS 1 USER-002
... ... ...
You are now selecting all the columns instead of counting the values you want. Try the following query
Select TCODE, Sum(Tcount), Userid, TTEXT From Sap_Security_Log Group by Tcode, userid, ttext
This sums up the Tcount for all the rows in which all the values in the columns in your 'group by' are the same. Note that the column Tcount is not in the group by.