My sample table data is:

and my sql query is:
SELECT
Distinct
CASE CHARINDEX( '?', SessionURL)
WHEN 0 THEN SessionURL
ELSE LEFT(SessionURL, CHARINDEX( '?', SessionURL) - 1) END AS VisitPage, count(*) as [VisitTime]
FROM SessionTracker
group by SessionURL
order by [VisitTime] desc
Query run sucessfully and returns a value with out query string.Means result from above data is:

But I want a result only in a format:
Default
Modules
Is it possible this type of filter in sql query.If yes suggest a way.Thanks.
Yes. The same way as you filter the querystring, filter on the / and the . You need the
SUBSTRINGfunction. To find the last occurence of the /, use theREVERSEfunction.ie.