SELECT * FROM tbl_permit AS p JOIN tbl_permit_type AS pt ON pt.code = SUBSTR(p.permit_id, 4, INSTR(SUBSTR(p.permit_id, 4, LENGTH(p.permit_id)),'-')-1) LEFT JOIN mygov_pharr_tx__lm.tbl_location AS l ON p.location_id = l.location_id WHERE 1 AND p.permit_issue_date != '0000-00-00' AND p.permit_issue_date >= '2017-10-19' AND p.permit_issue_date <= '2017-10-20 23:59:59' AND pt.type_id = '39' AND p.permit_type_code != '' AND ( EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '1'  AND tds1.store_value REGEXP '^[[:space:]]*$' ) )        )  AND EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '2'  AND tds1.store_value LIKE '%%' ) )        )  AND EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '3'  AND tds1.store_value REGEXP '^[[:space:]]*$' ) )        ) )  
0
SELECT * FROM tbl_permit AS p JOIN tbl_permit_type AS pt ON pt.code = SUBSTR(p.permit_id, 4, INSTR(SUBSTR(p.permit_id, 4, LENGTH(p.permit_id)),'-')-1) LEFT JOIN mygov_pharr_tx__lm.tbl_location AS l ON p.location_id = l.location_id WHERE 1 AND p.permit_issue_date != '0000-00-00' AND p.permit_issue_date >= '2017-10-19' AND p.permit_issue_date <= '2017-10-20 23:59:59' AND pt.type_id = '7' AND p.permit_type_code != '' AND ( EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '1'  AND tds1.store_value REGEXP '^[[:space:]]*$' ) )        )  AND EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '2'  AND tds1.store_value LIKE '%%' ) )        )  AND EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '3'  AND tds1.store_value REGEXP '^[[:space:]]*$' ) )        ) )  
78738
SELECT * FROM tbl_permit AS p JOIN tbl_permit_type AS pt ON pt.code = SUBSTR(p.permit_id, 4, INSTR(SUBSTR(p.permit_id, 4, LENGTH(p.permit_id)),'-')-1) LEFT JOIN mygov_pharr_tx__lm.tbl_location AS l ON p.location_id = l.location_id WHERE 1 AND p.permit_issue_date != '0000-00-00' AND p.permit_issue_date >= '2017-10-19' AND p.permit_issue_date <= '2017-10-20 23:59:59' AND pt.type_id = '8' AND p.permit_type_code != '' AND ( EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '1'  AND tds1.store_value REGEXP '^[[:space:]]*$' ) )        )  AND EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '2'  AND tds1.store_value LIKE '%%' ) )        )  AND EXISTS (SELECT * FROM mygov_pharr_tx__lm.tbl_datastore AS tds1         WHERE tds1.location_id = l.location_id         AND ( (tds1.type_id = '3'  AND tds1.store_value REGEXP '^[[:space:]]*$' ) )        ) )  
0
City of Pharr's
Inspections Summary - By Region
10/19/17 to 10/20/17
  Permit Applications Permits Issued Total Value
NEW BUSINESS 1 1 $0.00
New Commercial Permit 1 1 $12,000,000.00
Garage Sale Permit 20 20 $0.00
Totals 22 22 $12,000,000.00
Average 7 $4,000,000.00
MYGOV.US
Inspections Summary - By Region
Printed 10/20/17 at 4:00 AM