cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while using aggregate functions in EJB QL 2.1

Former Member
0 Kudos

Hai all,

I am using aggregate function as follows

select max(c.id) from customer as c

for this iam selected check box EJB QL 2.1 in persistent.xml

this is validated by nwds, but while deploying server raising error like ejb ql syntax error.

Actually according to EJB QL 2.1 this is a valid query, what i need to do for run this same query .

Anybody please help me in this regard

Regards

Somaraju

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

try rewriting the query like this

select max(c.id) as c from customer

Regards,

Beevin

Former Member
0 Kudos

Hai Joseph,

This is not working

Regards

Somaraju

Former Member
0 Kudos

Hi,

if u want to simply select the max value u can use this query

select max(id) from customer

one more method to write this query is

select max(c.id) as maximum from customer c

Regards,

Beevin.

Former Member
0 Kudos

Beevin

Both two are not even validated,

but with the first one as select max(c.id) from customer as c , in this case it is validated but while deploying it is error as , object must be return

But when i saw the ejb2.1 specification we can write this type of queries also ?

Is it problem with was any thing

Regards

Somaraju

Former Member
0 Kudos

Hi,

Can you post the method in which u are calling this query

Regards,

Beevin.