lunes, 30 de noviembre de 2009

Query contra ISA para sacar reporte de navegacion de usuarios


select count(clientip) as hits , ClientUserName, desthost from

(
SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091023_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091024_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091025_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091026_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091027_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091028_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091029_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091030_WEB_000].[dbo].[WebProxyLog]

union

SELECT clientip, ClientUserName, Desthost, logtime
FROM [ISALOG_20091031_WEB_000].[dbo].[WebProxyLog]
) DATOS


where clientusername = 'usuario' o where clientusername like '%usuario%'
group by clientusername, desthost
order by hits desc

No hay comentarios: