> SELECT COUNT(xxx.*) FROM (<the query above>) xxx
This cause an error for me:ERROR: cannot pass result of subquery or join "xxx" to a function
Try this instead:SELECT COUNT(*) FROM (<the query above>) xxxIt worked for me.Regards,Suller Andras