From 2b716af46c38b4f29c52d326784890156dc0e986 Mon Sep 17 00:00:00 2001 From: DoNoBaN Date: Fri, 18 Feb 2011 16:17:21 +0100 Subject: [PATCH] Added Success Steal for detailed stats Needs add it to gui_cash_stats --- pyfpdb/SQL.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index e41d1a06..23f9d074 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2470,6 +2470,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 @@ -2601,6 +2613,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