Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- thana_id, count(*) rowCount,
- sum(case is_valid when true then 1 else 0 end) disbursableBenfCount,
- sum(amount) totalAmount,
- sum(case is_valid when (amount<=1350 and amount >=50 and amount%25=0) then amount else 0 end) validAmnt,
- sum(case is_valid when true then amount else 0 end) DisbursableAmnt
- FROM
- pesp_db_p23_live.disbursement_sheet_raw_data_report ds
- INNER JOIN
- pesp_db_p23_live.school sc ON ds.school_code = sc.school_code
- where thana_id in (277,61,294)
- group by sc.thana_id
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement