[rules-users] Drools Language Enhancements
Wolfgang Laun
wolfgang.laun at gmail.com
Wed Feb 12 06:24:32 EST 2014
On 12/02/2014, Raja Sekhar <raja.amirapu at gmail.com> wrote:
> Hi All,
> I came across this link
>
> https://community.jboss.org/wiki/DroolsLanguageEnhancements#jive_content_id_SQL_Group_Operators
Skip down to the red "Done" and disregard everything before unless
you'd like to implement one of those proposals :-)
-W
>
> select location, age, avg(income), min(income), max(income) from Person
> group by location, age //SQL
>
>
>
> acc( $p : Person();
> [$l, $a] : distinct( $p.location, $p.age) )
> acc( $p : Person( location == $l, age == $a );
> $avgIncome : avg( $p.income ) ,
> $minIncome : min( $p.income ),
> $maxIncome : max( $p.income ) )
>
>
>
> If we wanted to make a list of lists we could add:
>
> acc( $l : List() from [$avgIncome, $minIncome, $maxIncome],
>
> list( $l )
>
>
> Can some give me specific example with this
>
>
> Regards,
>
> --
> Raja Sekhar Amirapu
> ------------------------------------------------------
> "If any anyone can do it, i can do it. If no one else can do it, i must do
> it"
>
More information about the rules-users
mailing list