|
@@ -154,17 +154,9 @@ with sqlite3.connect(f"file:{dbFile}?mode=ro", uri=True) as connection:
|
|
|
tmpQuery = theQuerySimp2(','.join(codesStr), ','.join(formCodesStr))
|
|
|
querr = 'CREATE TEMPORARY TABLE stuff AS ' + tmpQuery
|
|
|
connection.execute(querr)
|
|
|
- riQuery = "SELECT * FROM stuff LEFT JOIN Occ00001 AS prev_tab ON prev_tab.ntx = stuff.ntx AND prev_tab.mappa = stuff.mappa - 15"
|
|
|
+ riQuery = "SELECT stuff.*, prev_tab.mappa, periodi.pfin FROM stuff LEFT JOIN Occ00001 AS prev_tab ON prev_tab.ntx = stuff.ntx AND prev_tab.mappa = stuff.mappa - 15 LEFT JOIN periodi ON stuff.ntx = periodi.ntx AND stuff.numperiod = periodi.numperiod"
|
|
|
results2Simp2 = pd.read_sql(tmpQuery, connection)
|
|
|
|
|
|
-print(time.time() - timestamp0)
|
|
|
-
|
|
|
-with sqlite3.connect(f"file:{dbFile}?mode=ro", uri=True) as connection:
|
|
|
- cur = connection.cursor()
|
|
|
- queryTmp = f'SELECT prev_tab.pitxt AS piniz FROM Occ00001 AS prev_tab, periodi WHERE {pazzi}'
|
|
|
- cur.execute(queryTmp)
|
|
|
- res = cur.fetchall()
|
|
|
-
|
|
|
print(time.time() - timestamp0)
|
|
|
|
|
|
|
|
@@ -183,15 +175,4 @@ with sqlite3.connect(f"file:{dbFile}?mode=ro", uri=True) as connection:
|
|
|
results2Simp2GNU = pd.read_sql(theQueryGNU(), connection)
|
|
|
|
|
|
print(time.time() - timestamp0)
|
|
|
-
|
|
|
-results2Simp2
|
|
|
-
|
|
|
-results2
|
|
|
-
|
|
|
-len(results2Dict)
|
|
|
-
|
|
|
-len(results2Simp2)
|
|
|
-
|
|
|
-for index, row in results2Simp2.iterrows():
|
|
|
- print(row['mappa'])
|
|
|
-
|
|
|
+
|