Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 8th, 2012  |  syntax: None  |  size: 0.19 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SQL sum(IF()) in JPQL Criteria
  2. select sum(if(is_pending=1,1,0)) as num_pending_orders,
  3.        group_concat(if(is_pending),date) as pending_orders_dates from Orders
  4.        group by country;