Re: DQL – Repeating attribute with count

I am qurying count value of repeating attribute from a table and need to include where clause along with it.

The query in SQL works perfect, but facing issues in DQL due to repeating attribute.I refered DQL reference,

Content Server fundamentals etc. Still unable to get it right.

SQL : works perfect

select count(R_VERSION_LABEL),object_name

from custom_type_rp t,

custom_type_sp t1

where t1.custom_attr like ‘ABC%’

and t1.R_OBJECT_ID = t.R_OBJECT_ID

group by object_name

having count(R_VERSION_LABEL) > 20


DQL : giving error

select count(R_VERSION_LABEL) as “pp”,object_name from custom_type

where custom_attr like ‘ABC%’ group by object_name having count(R_VERSION_LABEL) > 10

In above DQL, I am unable to execute the expresssion after ‘having’ since it is a repeating attribute.

Any idea how to do it.

Related:

Leave a Reply