worked for me. Plus, that is what Adobe shows in their docs.
2009/3/16 Jason Fisher :
>
> Interesting ... COUNT(DISTINCT prodcode) will work, huh? That may come in
> handy some day. Thanks!
>
>
>
>
~|
Adobe® ColdFusion® 8 so
COUNT(DISTINCT [fieldName] is very important to remember when using JOINS. For
example, if you have the query...
SELECT COUNT(A.code) AS total
FROM TableA A INNER JOIN TableB ON A.code = B.code
And you wanted to know how many records in TableA have records in TableB.
If this query returns 10
Interesting ... COUNT(DISTINCT prodcode) will work, huh? That may come in
handy some day. Thanks!
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doublecli
Thanks. I found it finally.
The right syntax (for this issue) is select count(distinct prodcode) as prodcnt
There was a second issue with computed_field_1 the was being bounced
by the ODBC driver as well.
On Mon, Mar 16, 2009 at 3:54 PM, Jason Fisher wrote:
>
> This is invalid:
>
> distinct(
This is invalid:
distinct(count prodcode)
Are you trying to do a DISTINCT on the aggregate function COUNT()?
Not sure that would work, but it would have to be DISTINCT COUNT(prodcode)
if that's what you're after.
~|
Adobe
I forgot the code snippet.
select distinct(count prodcode)
from product
where product.manufid = '#scan.manufid#'
AND product.famcode2 matches '#left(scan.famcode, 2)#.'
ANDproduct.famcode2 matches '#left(scan.famcode,1)#..'
AND
h your database
structure, and not your CF.
If this doesn't work, we'll need that "incredibly annoying SQL syntax error"
posted.
Hope this helps,
Matthieu
> -Original Message-
> From: Jann VanOver [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 11, 2001 4:55 PM
&
So, what was the "incredibly annoying SQL syntax error" ?? Did it give you
any clues? Did you try ing the text of the query before executing
to make sure it looks right?
-Original Message-
From: Erika Foster [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 03, 2000 7:42 PM
To: CF-Talk
Not knowing what types the fields or variables are, or what the setup is like,
its a little hard to comment...
However, one thing that springs to mind is does it require a username and
password in the CFQUERY?
David Cummins
Erika Foster wrote:
>
> Hi there,
>
> I've got this whole application
9 matches
Mail list logo