[dev] Re: [cvs] commit: framework/DataTree/DataTree sql.php

Duck duck at obala.net
Wed Sep 1 02:15:36 PDT 2004


oh. Is is morning, I didn't see... yo use postgres.  :)

I dont have any postgres instalation around. But in documentation is wriiten 
"When GROUP BY is present, it is not valid for the SELECT output 
expression(s) to refer to ungrouped columns except within aggregate 
functions, since there would be more than one possible value to return for an 
ungrouped column.". So probably you must must add the colums needed to the 
group part. So the return line from buldattributequery would be 

return sprintf('SELECT %s FROM %s c %s WHERE c.group_uid = %s AND %s %s %s 
GROUP BY a1.datatree_id, c.datatree_name  ORDER BY c.datatree_order, 
c.datatree_name, c.datatree_id',

note the ", c.datatree_name" added in the group by column

try, and let me know-

Duck


More information about the dev mailing list