You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Alexandre Gomes <al...@gmail.com> on 2006/06/29 02:09:53 UTC

Re: doing a select distinct

Hi Rupinder,

   Something like this executed from a beanshell file will bring the
distinct statusIds from the OrderHeader entity.

    orderBy = UtilMisc.toList("statusId");
    findOpts = new EntityFindOptions();
    findOpts.setDistinct();
    fieldsToSelect = UtilMisc.toList("statusId");
    exprs.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, null));
    condition = new EntityConditionList(exprs, EntityOperator.AND);
    statusList = delegator.findByCondition("OrderHeader", condition,
null, fieldToSelect, orderBy, findOpts);

   Regards,
Alexandre Gomes

On 6/28/06, Rupinder Singh Mazara <rm...@masterfile.com> wrote:
> hi all
>
>   how can i carry out a "select distinct status_id from order_header
> order by status_id "
>  via the delegator !
>
>  thanks
>
>
>