I need some help from your SQL gurus out there :)
Here's the deal: we are keeping a running tally of the sermons which have
been downloaded the most over the past 30 days. Every time a sermon is
downloaded, I write a record out to a sermons_details table, where the
primary key is the sermon
Why not do a join... something like this I expect...
cfquery name=sermon_nums datasource=maindsn maxrows=5
SELECT sermons_details.sermon_num, count(sermons_details.sermon_num) AS
tally
sermons.title etc, speakers.initials
FROM sermons_details
JOIN sermons ON
?
David
David Grabbe
Manager, Information Systems
Church of the Great God
[EMAIL PROTECTED]
http://www.cgg.org
-Original Message-
From: Brian Scandale [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 3:32 PM
To: CF-Talk
Subject: Re: SQL insanity
Every item in the select statement other than the count needs to be in the group by
statement
-Original Message-
From: David Grabbe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 4:01 PM
To: CF-Talk
Subject: RE: SQL insanity...
I tried this:
cfquery name=sermon_nums
-
From: David Grabbe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 3:01 PM
To: CF-Talk
Subject: RE: SQL insanity...
I tried this:
cfquery name=sermon_nums datasource=maindsn maxrows=5
SELECT sermons_details.sermon_num, count(sermons_details.sermon_num) AS
tally, sermons.title
or something similar...
-Original Message-
From: David Grabbe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 3:01 PM
To: CF-Talk
Subject: RE: SQL insanity...
I tried this:
cfquery name=sermon_nums datasource=maindsn maxrows=5
SELECT sermons_details.sermon_num
, April 17, 2002 4:03 PM
To: CF-Talk
Subject: RE: SQL insanity...
Every item in the select statement other than the count needs to be in the
group by
statement
-Original Message-
From: David Grabbe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 4:01 PM
To: CF-Talk
Subject: RE: SQL
= #sermon_num#
cfif Ns_Num neq Os_num
some code
/cfif
cfset Os_Num = #sermon_num#
/cfloop
-Original Message-
From: David Grabbe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 4:01 PM
To: CF-Talk
Subject: RE: SQL insanity...
I tried
8 matches
Mail list logo