DQL count(*)

Options
Imran_Yusubov
edited December 14, 2012 in Documentum #1

Hello Experts,

Is it possible to count and  query some attributes in dql. For example, select count(*) as result, object_name from dm_document?

Thanks in advance

Tagged:

Comments

  • msroth
    edited December 7, 2012 #2
    Options
    Yes, sort of.  You will need to group by whatever the other attribute is you are querying on.  For example:
    select count(*), object_name from dm_document where folder('/Temp') group by object_name
    which isn't very meaningful, but works.
  • Imran_Yusubov
    edited December 11, 2012 #3
    Options

    This is helpful but   not exactly what i am looking for.

    I have a taskspace search form and when ever users makes a search I want to display the number of results found.

    But I guess that is not possible.

  • mszurap
    edited December 14, 2012 #4
    Options

    You can do it with another query.

    I suppose you can get the final DQL which you need to execute.

    Execute the original query, then execute the following:

    select count(*) from (YOUR_ORIGINAL_DQL)

    You may need to remove the order by statement from the original dql.