this work in MySql?
add
(SELECT(SUM(i.NumberOfAttendees) FROM tablename)) as mysum
to your select...like this
SELECT a.firstname, a.lastname,p.AbbreviateMyFirstName, i.Comment,
i.NumberOfAttendees, p.PhotoLink,
(SELECT(SUM(i.NumberOfAttendees) FROM tablename)) as mysum
I seem to recall mySQL not liking this beast though....
Why not just use QofQ?
Doug
On Thu, 14 Oct 2004 12:10:19 -0400, Anders Green <[EMAIL PROTECTED]> wrote:
> At 12:04 PM 10/14/2004, Donna wrote:
> >everyone ... has fried their brains on code
>
> I'm working on this:
>
> <cfquery name="inviteesY" DATASOURCE=#databaseName#>
> SELECT a.firstname, a.lastname,p.AbbreviateMyFirstName, i.Comment,
> i.NumberOfAttendees, p.PhotoLink
> FROM (Invitee i INNER JOIN AddressBook a
> ON i.EventBelongID=#eventID# AND
> i.AddressBookTargetID=a.ID)
> LEFT OUTER JOIN Person p
> ON p.ID = a.PersonTargetID
> WHERE i.Status = 'Y'
> </cfquery>
>
> Query works properly, but I want to get a sum
> of one of the columns, and MySQL only wants to
> sum groups, and this query has no groups.
>
> That is, I want to add SUM(i.NumberOfAttendees)
> to the list of things selected.
>
> Uh, so yes, the list is working. *grin*
>
> Anders
>
> +===========================================================+
> |Anders Green Email: [EMAIL PROTECTED] |
> | Home: 919.303.0218 |
> | Off Road Rally Racing Team: http://linaracing.com/ |
>
>
>
> +===========================================================+________________________________
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

