by kraada » Tue Jun 24, 2008 5:07 pm
So, the different flop cards are id_flop1, id_flop2 and id_flop3.
The cards are stored as a number, I'm not sure whether it goes up from 0 being the As or from 0 being the 2c, but they go in order: 2c + 1 = 3c, 3c + 1 = 4c, etc.
The last piece you need here is the modulo function (%) which returns the remainder when divided by the number in question ( so 8 % 3 = 2, for example).
What this amounts to is you can write the report with the filter:
(id_flop1 % 13 = id_flop2 % 13) OR (id_flop1 % 13 = id_flop3 % 13) OR (id_flop2 % 13 = id_flop3 % 13)
This works because if you enumerate card numbers in the fashion described, since there are 52 cards in a deck and 4 * 13 = 52. As such if you find the remainder when dividing by 13 you will always end up with the same card rank.
Incidentally, this query takes quite a while . . .
Edit: And apparently uses a lot of RAM. I just got a "you're low on resources" message indicating that my 1G of ram and 1G of swap are both nearly taxed out. Maybe there's a better way to do this as a custom stat and then you can just filter on the stat being true? I'm not sure I'll have to look into it.