Advertisement
naimul64

Untitled

Apr 17th, 2017
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.53 KB | None | 0 0
  1. SELECT
  2.     thana_id, count(*) rowCount,
  3.     sum(case is_valid when true then 1 else 0 end) disbursableBenfCount,
  4.     sum(amount) totalAmount,
  5.     sum(case is_valid when (amount<=1350 and amount >=50 and amount%25=0) then amount else 0 end) validAmnt,
  6.     sum(case is_valid when true then amount else 0 end) DisbursableAmnt
  7. FROM
  8.     pesp_db_p23_live.disbursement_sheet_raw_data_report ds
  9.         INNER JOIN
  10.     pesp_db_p23_live.school sc ON ds.school_code = sc.school_code
  11. where thana_id in (277,61,294)
  12. group by sc.thana_id
  13. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement