All pastes #3734 Raw Edit

Anonymous

public text v1 · immutable
#3734 ·published 2005-01-04 16:05 UTC
rendered paste body
update cdr set call_cost =
(select (CASE billsec % 6
      WHEN 0 THEN ((( (billsec/6) *6)::float(1)/60)::float(1) * (select rate from rates where rate_class = cdr.userfield and
mbrid = mbr.mbrid)  )::float(1)
      ELSE        ((( ((billsec/6 +1)* 6))::float(1)/60)::float(1)* (select rate from rates where rate_class = cdr.userfield
and mbrid = mbr.mbrid) )::float(1)
    END) from cdr,mbr,rates where acctid = 196933::bigint
and mbr.accountcode = cdr.accountcode
and rate_class = cdr.userfield
and rates.mbrid = mbr.mbrid)
where cdr.acctid = 196933::bigint;