RE: Distinct value count (SQL)

2006-04-11 Thread Ben Nadel
--Original Message- From: Nick Han [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 6:01 PM To: CF-Talk Subject: RE: Distinct value count (SQL) Ben, Do this, assuming you're using sql server. Select count(distinct user_id) From orders -Original Message-

RE: Distinct value count (SQL)

2006-04-11 Thread Nick Han
Ben, Do this, assuming you're using sql server. Select count(distinct user_id) From orders -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 2:51 PM To: CF-Talk Subject: Distinct value count (SQL) So, I have to do qu

Distinct value count (SQL)

2006-04-11 Thread Ben Nadel
So, I have to do queries occassionally where I have to get the count of unique items in a query. I don't want to return the items, I just want to count them. I end up doing something like: -+ SELECT COUNT(*) AS user_count FROM ( SELECT DI