aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/correlation/pre_computes.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/wqflask/wqflask/correlation/pre_computes.py b/wqflask/wqflask/correlation/pre_computes.py
index afcea88f..20fe84e3 100644
--- a/wqflask/wqflask/correlation/pre_computes.py
+++ b/wqflask/wqflask/correlation/pre_computes.py
@@ -238,19 +238,13 @@ def write_db_to_textfile(db_name, conn, text_dir=TMPDIR):
writer.writerows(data.values())
with conn.cursor() as cursor:
cursor.execute(
- "SELECT ProbeSet.Name,Strain.Name, ProbeSetData.value "
- "FROM (ProbeSetData, ProbeSetFreeze, Strain, ProbeSet, "
- "ProbeSetXRef) LEFT JOIN ProbeSetSE ON "
- "(ProbeSetSE.DataId = ProbeSetData.Id AND "
- "ProbeSetSE.StrainId = ProbeSetData.StrainId) "
- "LEFT JOIN NStrain ON "
- "(NStrain.DataId = ProbeSetData.Id AND "
- "NStrain.StrainId = ProbeSetData.StrainId) "
- "WHERE ProbeSetXRef.ProbeSetId = ProbeSet.Id "
- "AND ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id "
- "AND ProbeSetFreeze.Name = %s AND "
- "ProbeSetXRef.DataId = ProbeSetData.Id "
- "AND ProbeSetData.StrainId = Strain.Id "
+ "SELECT ProbeSet.Name, Strain.Name, ProbeSetData.value "
+ "FROM Strain LEFT JOIN ProbeSetData "
+ "ON Strain.Id = ProbeSetData.StrainId "
+ "LEFT JOIN ProbeSetXRef ON ProbeSetData.Id = ProbeSetXRef.DataId "
+ "LEFT JOIN ProbeSet ON ProbeSetXRef.ProbeSetId = ProbeSet.Id "
+ "WHERE ProbeSetXRef.ProbeSetFreezeId IN "
+ "(SELECT Id FROM ProbeSetFreeze WHERE Name = %s) "
"ORDER BY Strain.Name",
(db_name,))
results = cursor.fetchall()