Ok, it took some custom work but here is the SQL statement that will give you the holecards. This statement is for when the holecards are known. I had to add a lookup table that shows how the numerical number = actual card ( 1=2c, 2=3c, 3=4c, etc..) so you will need to add a lookup table to do this. I called my table 'lookup_cards', with two colums 'id_card', and 'card'. The 'id_card' column is the primary key 1-52 and the 'card' column is the actual card (jc, 4d, 3h, etc...)
If you are having problems creating the 'lookup_cards' table, send me a PM and I can email you a .backup file with just that table then you should be able to restore the table so the query will work.
Chuck
- Code: Select all
SELECT player.player_name, amt_f_raise_made, amt_f_bet_facing, H1.card AS holecard1, H2.card as holecard2, F1.card AS flopcard1, F2.card AS flopcard2, F3.card AS flopcard3
FROM ((holdem_hand_player_statistics INNER JOIN holdem_hand_player_detail ON holdem_hand_player_statistics.id_hand = holdem_hand_player_detail.id_hand) INNER JOIN player ON holdem_hand_player_detail.id_player = player.id_player) INNER JOIN holdem_hand_summary ON holdem_hand_player_statistics.id_hand = holdem_hand_summary.id_hand, lookup_cards H1, lookup_cards H2, lookup_cards F1, lookup_cards F2, lookup_cards F3
WHERE amt_f_bet_made = 0 AND flg_f_check_raise AND amt_f_raise_made = (amt_f_bet_facing*2) AND amt_f_bet_facing > 0 AND holecard_1 > 0 AND holecard_2 > 0 and holecard_1 = H1.id_card AND holecard_2 = H2.id_card AND card_1 = F1.id_card AND card_2 = F2.id_card AND card_3 = F3.id_card
GROUP BY player.player_name, amt_f_raise_made, amt_f_bet_facing, holecard_1, holecard_2, H1.card, H2.card, F1.card, F2.card, F3.card
ORDER BY player.player_name ASC
lookup_cards table
1 = 2c
2 = 3c
3 = 4c
4 = 5c
5 = 6c
6 = 7c
7 = 8c
8 = 9c
9 = Tc
10 = Jc
11 = Qc
12 = Kc
13 = Ac
14 = 2d
15 = 3d
16 = 4d
17 = 5d
18 = 6d
19 = 7d
20 = 8d
21 = 9d
22 = Td
23 = Jd
24 = Qd
25 = Kd
26 = Ad
27 = 2h
28 = 3h
29 = 4h
30 = 5h
31 = 6h
32 = 7h
33 = 8h
34 = 9h
35 = Th
36 = Jh
37 = Qh
38 = Kh
39 = Ah
40 = 2s
41 = 3s
42 = 4s
43 = 5s
44 = 6s
45 = 7s
46 = 8s
47 = 9s
48 = Ts
49 = Js
50 = Qs
51 = Ks
52 = As