I was trying to use COUNT aggregation on node id arguments, in order to find an argument based way of limiting the amount of nodes displayed in a view result.

However I get the following message:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'COUNTnode.nid' in 'having clause'

And the same seems to happen for other aggregation functions e.g SUM

I am attaching the resulting SQL query, which you can clearly see is busted, and also the view export.

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs tests
StatusFileSize
new3.95 KB

Every bug which produces a problem in the query part should definitive get a test, so add a tag.

I couldn't reproduce your problem in the current dev version, see attached view. Maybe you could try to build a view which fails and can be imported into every drupal installation, this would be wonderful!

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)