ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant Punekar <Prashant_Pune...@mindtree.com>
Subject generate complicated query using entity engine !
Date Thu, 21 Oct 2010 01:24:35 GMT
Hi,

Has anyone used "case when" statement  using entity engine ?
Here is the query which I want to generate using the entity engine .....

********************************************************************************
Update velocity_retailer_counter
Set         total$ = CASE
      WHEN HOUR(TIMEDIFF(NOW(),Last_Update_Date)) > Period_Hours THEN Txn.Value
       ELSE (total$ + Txn.Value)
END CASE
                ,Total_Txns =  CASE
      WHEN HOUR(TIMEDIFF(NOW(),Last_Update_Date)) > Period_Hours THEN 1
                      ELSE (total_txns + 1)
END CASE

Where RetailerID = Txn.RetailerID

********************************************************************************

Regards,
Prashant

________________________________
http://www.mindtree.com/email/disclaimer.html

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message