Try adding phid to your group by statement

-----Original Message-----
From: Michael Lugassy [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 11:11
To: CF-Talk
Subject: Simple SQL SELECT


I'm trying to simply select a few colums from a table (phID,phCOL)
+ the count of that certain select each time into a variable (coPHOTOS)

SELECT phID, phCOL, COUNT(phID) As coPHOTOS FROM photos
WHERE phGROUP='#grid#' AND phCOL IS NOT NULL
GROUP BY phCOL

I keep on getting an error: Column 'photos.phID' is invalid in the select
list because it is not contained in either an aggregate function or the
GROUP
BY clause.

What is wrong? Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to