From aea40ab6050bdeb51a3e82ccaee1824aeca40392 Mon Sep 17 00:00:00 2001 From: DoNoBaN Date: Fri, 18 Feb 2011 00:42:59 +0100 Subject: [PATCH] Add success steal for detailed stats --- pyfpdb/SQL.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index cc50633b..feb3a67f 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2324,6 +2324,18 @@ class Sql: end ) end AS steals + ,case when sum(cast(hp.success_Steal as integer)) = 0 then -999 + else 100.0 * + sum(cast(hp.success_Steal as integer)) + / + sum(case hp.position + when 'S' then cast(hp.raisedFirstIn as integer) + when '0' then cast(hp.raisedFirstIn as integer) + when '1' then cast(hp.raisedFirstIn as integer) + else 0 + end + ) + end AS suc_steal ,100.0*sum(cast(hp.street1Seen as integer))/count(1) AS saw_f ,100.0*sum(cast(hp.sawShowdown as integer))/count(1) AS sawsd ,case when sum(cast(hp.street1Seen as integer)) = 0 then -999