SQL insanity...

2002-04-17 Thread David Grabbe
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

Re: SQL insanity...

2002-04-17 Thread Brian Scandale
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

RE: SQL insanity...

2002-04-17 Thread David Grabbe
? 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

RE: SQL insanity...

2002-04-17 Thread David DiPietro
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

RE: SQL insanity...

2002-04-17 Thread Mark A. Kruger - CFG
- 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

RE: SQL insanity...

2002-04-17 Thread Mark A. Kruger - CFG
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

RE: SQL insanity...

2002-04-17 Thread David Grabbe
, 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

RE: SQL insanity...

2002-04-17 Thread David DiPietro
= #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