[rt-users] Chart grouped by customfield

Joop van de Wege JoopvandeWege at mococo.nl
Wed Oct 10 13:40:16 EDT 2007


Jesse Vincent wrote:
> I suspect that it has to do with "this was tested on mysql and pg"
> Any oracle folks see what we're doing wrong with that SQL?
> 
>> There is DBD prepare errors:
>>
>> RT: RT::Handle=HASH(0x8134df1c) couldn't prepare the query 'SELECT 
>> COUNT(main.id) AS id, ObjectCustomFieldValues_1.Content AS col1 FROM ( 
>> SELECT DISTINCT main.id FROM Tickets main LEFT JOIN 
>> ObjectCustomFieldValues ObjectCustomFieldValues_1  ON ( 
>> ObjectCustomFieldValues_1.CustomField = '1' ) AND ( 
>> ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' ) AND ( 
>> ObjectCustomFieldValues_1.Disabled = '0' ) AND ( 
>> ObjectCustomFieldValues_1.ObjectId = main.id )  WHERE (main.Status != 
>> 'deleted') AND (main.Status != 'resolved') AND (main.Type = 'ticket') 
>> AND (main.EffectiveId = main.id)  ) distinctquery, Tickets main WHERE 
>> (main.id = distinctquery.id)  GROUP BY ObjectCustomFieldValues_1.Content

Problem is that in the group by there is a alias which is defined in the 
subquery.
ObjectCustomFieldValues_1 is only known in the innermost query not the 
outer one.
There is another problem aswell since modifing the query gives me 
another unidentified error.
I'll see if my DBA can have a look at it.


Joop




More information about the rt-users mailing list