Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators
Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: syntax error at or near "ORDER" LINE 1: ..._hand_player_statistics.id_gametype IN (2))) AND ORDER BY
AND id_site='100')) AND (1=1) AND ORDER BY (timezone('UTC', cash_hand_playe
AND ((cash_hand_player_statistics.id_hand in (
select chps.id_hand from cash_hand_player_statistics chps
where chps.id_player in (
select cc.id_player
from cash_cache cc
where cc.cnt_players = 6
AND (((cash_hand_player_statistics.date_played >= (to_char(current_timestamp, 'YYYY-MM-01 00:00:00')::timestamp + INTERVAL '-2 HOURS') AND cash_hand_player_statistics.date_played <= (to_char(current_timestamp + INTERVAL '1 MONTH', 'YYYY-MM-01 00:00:00')::timestamp - INTERVAL '1 SECOND' + INTERVAL '-2 HOURS'))AND (cash_hand_player_statistics.id_gametype IN (2)))) group by cc.id_player having sum(cc.cnt_p_open_opp_btn) > 0 and ( (CASE WHEN ( (sum(cc.cnt_p_open_opp_btn) * 1.0) ) <> 0 THEN (((sum(cc.cnt_p_rfi_btn) * 1.0) * 1.0 )/( (sum(cc.cnt_p_open_opp_btn) * 1.0) )) ELSE 0 END) >= .7 ))))) GROUP BY (cash_hand_player_statistics.id_player), (player_real.id_site), (player.player_name)
kraada wrote:Try opening PGAdmin III and connecting to your database, clicking the SQL icon in the toolbar and running this query:
select chps.id_hand from cash_hand_player_statistics chps where chps.id_player in (select cc.id_player from cash_cache cc where cc.cnt_players = 6 group by cc.id_player having sum(cc.cnt_p_open_opp_btn) > 0 and ((sum(cc.cnt_p_rfi_btn) * 1.0) / (sum(cc.cnt_p_open_opp_btn) * 1.0) >= .7 )) LIMIT 5;
The LIMIT 5 portion returns a maximum of 5 hands - on my testing database, this took about 12 seconds. So it should return data quickly if it's going to return it at all.
BillGatesIII wrote:As far as I can remember, there is a way to get stuff like this working in a hand report, can't find the SQL I used right now, will look for it Thursday.
cash_hand_player_statistics.id_hand in (
select chps.id_hand
from cash_hand_player_statistics as chps
where chps.flg_p_first_raise
and chps.flg_p_open_opp
and chps.position = 0
and chps.id_player in (
select
distinct on (pt.id_player) pt.id_player
from (
select
cc.id_player,
sum(cc.cnt_hands) over pl as cnt_hands,
sum(cc.cnt_p_rfi_btn) over pl as rfi_btn,
sum(cc.cnt_p_open_opp_btn) over pl as rfi_btn_opp
from cash_cache as cc
where cc.id_gametype = 2
and cc.id_limit = 8
and cc.cnt_players between 4 and 6
and to_char(now(), 'YYYYWW')::int - cc.date_played_year_week <= 26
window pl as (partition by cc.id_player)) as pt
where pt.cnt_hands >= 100
and pt.rfi_btn_opp > 0
and 100.0 * pt.rfi_btn / pt.rfi_btn_opp >= 70))
and to_char(now(), 'YYYYWW')::int - cc.date_played_year_week <= 26
Return to Custom Stats, Reports and HUD Profiles
Users browsing this forum: No registered users and 25 guests