List:General Discussion« Previous MessageNext Message »
From:m i l e s Date:August 8 2005 9:05pm
Subject:Re: Query HELP!
View as plain text  
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
Query HELP!m i l e s8 Aug
  • Re: Query HELP!SGreen8 Aug
    • Re: Query HELP!m i l e s8 Aug
      • Re: Query HELP!SGreen8 Aug
  • Re: Query HELP!Peter Brawley8 Aug