You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by hzz6222003 <hz...@163.com> on 2012/02/14 11:01:03 UTC

how can l get the generic value list order by two filed

Hi, every one
 
the entity modle as follows:
<entity entity-name="Pay" package-name="com.iit.yinshang.order" title="Yingshang payment YLCard pay">
  <field name="orderId" type="id-ne" />
  <field name="amount1" type="currency-amount" />
 <field name="amount2" type="currency-amount" />
  <prim-key field="orderId" />
 </entity>
 
how can l get the rocorders by the following sql:
select * from pay order by amount1+amount2 desc
 
Kind Regards
huang zhong zhou

 

Re: how can l get the generic value list order by two filed

Posted by Nicolas Malin <ma...@librenberry.net>.
Hi huang
try to create a view-entity with complexe alias amount on amount1 and 
amount2.

Nicolas
Le 14/02/2012 11:01, hzz6222003 a ��crit :
> Hi, every one
>
> the entity modle as follows:
> <entity entity-name="Pay" package-name="com.iit.yinshang.order" title="Yingshang payment YLCard pay">
>    <field name="orderId" type="id-ne" />
>    <field name="amount1" type="currency-amount" />
>   <field name="amount2" type="currency-amount" />
>    <prim-key field="orderId" />
>   </entity>
>
> how can l get the rocorders by the following sql:
> select * from pay order by amount1+amount2 desc
>
> Kind Regards
> huang zhong zhou
>
>


-- 
Nicolas MALIN
Consultant
T��l : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Soci��t�� LibrenBerry
T��l : 02.48.02.56.12
Site : http://www.librenberry.net/