Hello, I discoverd what seems to be a bug in postgresql 7.4.12 (also on 7.4.7).
I have an example located at http://foo.fot.nu/psql/ with a simple example that delevers the correct result on 8.1 (tested by some nice person at #postgresql). It seems like the state variable is reseted every time a new grouped value pops up. /M -- Magnus Jonsson <[EMAIL PROTECTED]> I'm here looking for an answer, but I'm not sure about the question... ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq