Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 SQL: Distinct, Count & Group By ???
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

CarKnee
Junior Member

USA
297 Posts

Posted - 24 October 2003 :  17:03:23  Show Profile  Visit CarKnee's Homepage
MSDE

Thanks !

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 24 October 2003 :  17:05:04  Show Profile  Send ruirib a Yahoo! Message
Try this, then:


SELECT Z_CountryCode As Region, COUNT (*) 
FROM (SELECT DISTINCT
  USERS_LEADSYS_DOMESTIC_ZIPS.Z_CountryCode AS Region,
  USERS_DOWNLOADS.U_ID, USERS_DOWNLOADS.F_ID, 
  USERS_DOWNLOADS.P_ID
FROM 
  USERS_USERS U INNER JOIN
  USERS_LEADSYS_DOMESTIC_ZIPS ON 
  CONVERT(int, U.U_Zip) BETWEEN 
     USERS_LEADSYS_DOMESTIC_ZIPS.Z_Start AND  
     USERS_LEADSYS_DOMESTIC_ZIPS.Z_End INNER JOIN
  USERS_DOWNLOADS ON 
  U.U_ID = USERS_DOWNLOADS.U_ID INNER JOIN
  PRODUCTS_PRODUCTS ON 
  USERS_DOWNLOADS.P_ID = PRODUCTS_PRODUCTS.P_ID
) As T
Group By Z_CountryCode;




Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

CarKnee
Junior Member

USA
297 Posts

Posted - 24 October 2003 :  17:14:17  Show Profile  Visit CarKnee's Homepage
Thanks!
It seems to be working, but I will have to look more at Monday morning!

Thanks again, have a great weekend.

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 24 October 2003 :  17:18:41  Show Profile  Send ruirib a Yahoo! Message
Great. A nice weekend for you too.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07