Demo entry 5825091

a

   

Submitted by anonymous on Jul 17, 2016 at 15:46
Language: Python. Code size: 735 Bytes.

import psycopg2
import time

StartCPU = time.clock()
StratReal = time.time()
conn = psycopg2.connect("dbname='postgres' user='hallgato01' host='localhost' password='12345678'")
cur = conn.cursor()
#cur.execute("SELECT AVG(Demanda_uni_equil) FROM bimbo_train GROUP BY cliente_id, producto_id, agencia_id limit 100")
cur.execute("SELECT * FROM bimbo_train JOIN bimbo_test ON (bimbo_train.Cliente_ID=bimbo_test.Cliente_ID AND bimbo_train.Producto_ID=bimbo_test.Producto_ID AND bimbo_train.Agencia_ID=bimbo_test.Agencia_ID);")
rows = cur.fetchall()

print rows[0]

print('A program futasi ideje (CPU): ' + str(time.clock() - StartCPU) + ' sec')
print('A program futasi ideje (REAL): ' + str(time.time() - StratReal) + ' sec')

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).