Get Latest SQL Query for Sessions