how to get web page only having page ids in ()

Database
Enthusiast

how to get web page only having page ids in ()

Hi,

My problem is to find out data from page view table having 

particular web page ids only. 

select Visit_Id from WEB_PAGE_VIEW

where Page_View_Dttm between '2012-02-03 00:00:00' and '2012-02-05 23:59:59'     ------------- data for one Day

and web_Page_id in ('15489','89970716','89970221','89983065', '89983060','89983061','99173','787','99142','9814','112384356','117161548','7815','5738','89975151','89975150','4282','32544063','7194','9631','89971505','127411111','89971497')

and Concept_Cd='PB'

the above querry is giving me data of the page sequences having above page ids as one of the page in there sequence..

rather i want those user only which have been thru particularly thru those web pages only.

can anyone tell me how to reslove this issue.

 Visit_Id, Concept_Cd, Page_View_Sequence_Num, Page_View_Dttm, Web_Page_Id, Web_Page_Name.

are the fields of webpage view table. 

3 REPLIES
Senior Apprentice

Re: how to get web page only having page ids in ()

I'm not shure if i understand you correctly:

You want visits which only accessed any of those specific pages but no other?

This is one possible solution:

select Visit_Id from WEB_PAGE_VIEW
where Page_View_Dttm between '2012-02-03 00:00:00' and '2012-02-05 23:59:59'
and Concept_Cd='PB'
group by 1
having count(*) > 0
and sum(case when web_Page_id in ('15489','89970716','89970221','89983065',
'89983060','89983061','99173','787','99142','9814','112384356','117161548','7815',
'5738','89975151','89975150','4282','32544063','7194','9631','89971505','127411111',
'89971497') then 0 else 1 end) = 0

Dieter

Enthusiast

Re: how to get web page only having page ids in ()

hi dnoeth,

Yeah only those pages which include these page ids only.

n iguess this wud do...lemme check!!!

Enthusiast

Re: how to get web page only having page ids in ()

tnx