select s.username username,s.serial# serial,se.sid,n.name, max(se.value) maxmem from v$sesstat se, v$statname n, v$session s where n.statistic# = se.statistic# and s.sid=se.sid and s.username is not null group by n.name,se.sid,s.username,s.serial# order by 2