Created
January 13, 2016 18:14
-
-
Save ansmirnov/9cfba53bc1118b91f0f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# aboncnt.sh <areaid> <status_code> | |
DB_USER=... | |
DB_PASS=... | |
DB_NAME=... | |
ADDRESS_PID=... | |
/bin/echo "SELECT count(DISTINCT c.id) FROM contract_parameter_type_2 as p INNER JOIN contract as c ON p.cid=c.id WHERE p.hid in (SELECT id FROM address_house WHERE areaid=$1) AND c.status = $2 AND p.pid=${ADDRESS_PID};" | /usr/bin/mysql --skip-column-names -u${DB_USER} -p${DB_PASS} ${DB_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment