Hi all,

Using 8.1.4 and contrib/xml2.  When I do a 

select xpath_string(note, '//Thing') as note,
   count(aDate) from theTable
group by lower(xpath_string(note, '//Thing'))
order by 2 desc;

I get an error:
GROUP BY must contain note.  
But I can do that for a plain text/varchar field.  Adding the non-xpath 
note field messes up the grouping.

Can someone explain what interaction of features causes the above?  I'm
finding that to do the counts the way I want (case-insensitive with
trimmed blanks) I end up doing some variation of:

select note, count(aDate) from 
  (select  lower(xpath_string(note, '//Thing')) as note, aDate from 
theTable) as foo
group by note

tia,
arturo

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to