Jump to content
We've recently updated our Privacy Statement, available here ×

Must appear in GROUP BY error


djelebovk

Recommended Posts

Hi guys,

I have this simple query:

SELECT date_trunc('day', purchase_date), COUNT(*) FROM purchases GROUP BY date_trunc('day', purchase_date);[/code]

When I want to parametrize the query:

SELECT date_trunc($P{period}, purchase_date), COUNT(*)FROM purchases GROUP BY date_trunc($P{period}, purchase_date);[/code]

I am getting this error: ".... purchases.purchase date must appear in GROUP BY ... " both on jasper server 5.2.0 and on iReport Studio 5.6.0

First I've thought that the issue is with the driver. I've updated it and now I am using the latest one: "postgresql-9.4.1207"... again I get the same error. Then I've tested the driver by writting a tiny java program that does the same and it worked.

Thanks in advance, Kosta

P.S.

The example query is simple but the one I want to have in production is quite complex and I don't find a meaningful way to work around the use of such GROUP BY statement.

P.S.2

OMG I hate this editor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...