I am using Plone 2.5.5, CMF-1.6.4, Zope (Zope 2.9.8-final, python
2.4.4, linux2), Five 1.4.4, Python 2.4.4 (#1, Jun 16 2009, 12:19:17)
[GCC 4.3.2], PIL 1.1.6 and MySQL 5.0. I have installed the Zope MySQL
adapter and can write successful simple queries to the database. <br><br>I am having a problem with more complex queries:<br>SELECT
playerID, sum(PA) - sum(BB) - sum(HBP) - sum(SacBunt) AS AB FROM
offense WHERE gameID=&lt;dtml-sqlvar gameID type=int&gt; returns the
error <br>
OperationalError: (1140, &#39;Mixing of GROUP columns
(MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is
no GROUP BY clause&#39;)<br><br>When I try the same query on the mysql database (ie not through the ZMI and Z SQL Method), it works just fine.<br><br>The same query without the playerID works from both the ZMI and in mysql.<br>

SELECT sum(PA) - sum(BB) - sum(HBP) - sum(SacBunt) AS AB FROM
offense WHERE gameID=&lt;dtml-sqlvar gameID type=int&gt;<br><br>I looked in the Zope book and read the section on Relational Database Connectivity, so I tried<br>SELECT playerID, sum(PA) - sum(BB) - sum(HBP) - sum(SacBunt) AS AB FROM offense<br>

&lt;dtml-sqlgroup where&gt;<br>   gameID=&lt;dtml-sqlvar gameID type=int&gt;<br>&lt;/dtml-sqlgroup&gt;<br><br>and I get the same error. <br><br>So how do I translate the query<br>select playerID, sum(PA) - sum(BB) - sum(HBP) - sum(SacBunt) as AB from offense<br>

where gameID=&lt;an input value&gt; <br><br>into something that Z AQL Method understands?<br><br>Thanks!<br><font color="#888888"><br>Mark<br></font>