![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, IS the following query counting cumulative (see below **) pHITS or is it counting individual counts for each user for a particular day. Im not skilled enough to answer this question myself. My instinct says that its counting cumulative values and NOT individual counts for each property name. SELECT search_members.Property_Name AS pNAME, search_members.Property_Email AS pEMAIL, MAX(user_count.u_datetime) AS pDATE, **COUNT(user_count.u_userid) AS pHITS FROM search_members INNER JOIN user_count ON search_members.Property_ID = user_count.u_userid GROUP BY pNAME, pEMAIL, search_members.Property_ID ORDER BY pDATE DESC I have a feeling that the COUNT line should be something similar to select distinct statement.... Any ideas ? Sincerely, M i l e s. |
#3
| |||
| |||
|
|
Hi, IS the following query counting cumulative (see below **) pHITS or is it counting individual counts for each user for a particular day. Im not skilled enough to answer this question myself. My instinct says that its counting cumulative values and NOT individual counts for each property name. SELECT search_members.Property_Name AS pNAME, search_members.Property_Email AS pEMAIL, MAX(user_count.u_datetime) AS pDATE, **COUNT(user_count.u_userid) AS pHITS FROM search_members INNER JOIN user_count ON search_members.Property_ID = user_count.u_userid GROUP BY pNAME, pEMAIL, search_members.Property_ID ORDER BY pDATE DESC I have a feeling that the COUNT line should be something similar to select distinct statement.... Any ideas ? Sincerely, M i l e s. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Shawn, Took me a bit to digest what you were sayin but if I get it the way you splain'd it.... then the following should work: ++++++++++++++++++++++++++++++++++++++++++++++ SELECT cmc_search_members.PropertyName AS pNAME, cmc_search_members.PropertyEmail AS pEMAIL, cmc_user_count.user_id, MAX(cmc_user_count.date_time) AS pDATE, COUNT(cmc_user_count.user_id) AS pHITS FROM cmc_search_members INNER JOIN cmc_user_count ON cmc_search_members.Property_ID = cmc_user_count.user_id GROUP BY pNAME, pEMAIL ORDER BY pDATE DESC ++++++++++++++++++++++++++++++++++++++++++++++ If I want a NON-CUMULATIVE result, ie: pNAME + pHITS + pDATE ------------------------------- fillmore + 198 + 08/08/2005 mannor inn + 56 + 08/08/2005 seacrest + 23 + 08/08/2005 ------------------------------- fillmore + 102 + 08/07/2005 mannor inn + 89 + 08/07/2005 seacrest + 19 + 08/07/2005 etc. Then Im assuming the statement above will NOT produce this result ? What'd be great is if I could get that in Alphabetical order as well...I tried adding a ORDER BY pDATE DESC, pNAME ASC but DESC doesn't help. Which is what I was lookin for. |
| # |
![]() |
| Thread Tools | |
| Display Modes | |
| |