Using WHEN COUNT function in conjunction with Partition By [message #397161] |
Thu, 09 April 2009 04:41  |
amuller
Messages: 3 Registered: April 2009
|
Junior Member |
|
|
This is my query so far: and I want to introduce the condition that I want results only for users that their click count=5, how can I introduce in my query the WHEN COUNT (CLICKS) > 5 condition. Or any workaround to get only the info for those users with more than 5 clicks. Thanks
SELECT COMPUTER_ID, CLICK_DATE_1, CLICK_DATE_2, ADV.DB_FUNC_DATEDIFF('DD', CLICK_DATE_1, CLICK_DATE_2), NUM FROM (SELECT COMPUTER_ID, TO_CHAR (CLICK_DATE, 'YYYYMMDD') CLICK_DATE_1, TO_CHAR(LEAD(CLICK_DATE) OVER (PARTITION BY COMPUTER_ID ORDER BY CLICK_DATE), 'YYYYMMDD') CLICK_DATE_2,
RANK() OVER (PARTITION BY COMPUTER_ID ORDER BY CLICK_DATE)NUM FROM ADV.USER_CLICKS_SCORING_IT WHERE CONVERTIONS =0 AND CLICKS >0 AND INSTALLDT >= TO_DATE (''19/11/2008'', 'DD/MM/YYYY') )
WHERE CLICK_DATE_2 IS NOT NULL
|
|
|
|
|
|
|
|
|
|
|
|