Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- RS_HOST = 'cmcmbilling.c2upikbi0jsb.ap-northeast-2.redshift.amazonaws.com'
- RS_PORT = '5439'
- RS_DB = 'cmcmbilling'
- RS_USER = ''
- RS_PASS = ''
- con = psycopg2.connect(dbname=RS_DB, host=RS_HOST, port=RS_PORT, user=RS_USER, password=RS_PASS)
- cur = con.cursor()
- sql = """
- SELECT SUM(TO_NUMBER(NULLIF(BTRIM(usagequantity),''),'9999999999D9999999'))
- FROM car_201612
- WHERE usagetype='APS1-DataTransfer-Out-Bytes';
- """
- cur.execute(sql)
- cur.fetchone()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement