S
sudarsan1980
i have a dataset which pull all the info into a table , now i want to
use queries based on that table.
as an example in the following query it has both aggregate and group
by . is there a way i can execute such a statement on the dataset and
retrieve data. if sample code is given will appreciate.
i just need to retrieve data from datatable any method will do either
datatable or data row whatever as long as it work....
Here is one of my queries:
SELECT off_the_button as position,
COUNT(off_the_button) AS total_hands,
SUM(total_bet) AS vol_money_in_pot,
100 * SUM(cold_call_pf) / COUNT(off_the_button) AS
cold_call_pf_pct,
SUM(won_hand) AS num_won,
100 * SUM(won_hand) / COUNT(off_the_button) as win_pct,
SUM(saw_flop_n) AS saw_flop_n,
100 * SUM(won_hand) / COUNT(saw_flop_n) as win_pct_wsf,
SUM(blind_amt) AS blind_money,
SUM(total_won) AS money_won,
SUM(total_won) - SUM(blind_amt) AS diff_wo_blind$,
100 * SUM(went_to_showdown_n) / COUNT(off_the_button) AS
went2sd_pct,
100 * SUM(pre_flop_raise_n) / COUNT(off_the_button) AS
raise_pf_pct,
100 * SUM(raised_first_pf) / COUNT(off_the_button) AS
raise1st_pf_pct
FROM game_players
WHERE player_id = 1
GROUP BY off_the_button
thanks,
dotnetcoder
use queries based on that table.
as an example in the following query it has both aggregate and group
by . is there a way i can execute such a statement on the dataset and
retrieve data. if sample code is given will appreciate.
i just need to retrieve data from datatable any method will do either
datatable or data row whatever as long as it work....
Here is one of my queries:
SELECT off_the_button as position,
COUNT(off_the_button) AS total_hands,
SUM(total_bet) AS vol_money_in_pot,
100 * SUM(cold_call_pf) / COUNT(off_the_button) AS
cold_call_pf_pct,
SUM(won_hand) AS num_won,
100 * SUM(won_hand) / COUNT(off_the_button) as win_pct,
SUM(saw_flop_n) AS saw_flop_n,
100 * SUM(won_hand) / COUNT(saw_flop_n) as win_pct_wsf,
SUM(blind_amt) AS blind_money,
SUM(total_won) AS money_won,
SUM(total_won) - SUM(blind_amt) AS diff_wo_blind$,
100 * SUM(went_to_showdown_n) / COUNT(off_the_button) AS
went2sd_pct,
100 * SUM(pre_flop_raise_n) / COUNT(off_the_button) AS
raise_pf_pct,
100 * SUM(raised_first_pf) / COUNT(off_the_button) AS
raise1st_pf_pct
FROM game_players
WHERE player_id = 1
GROUP BY off_the_button
thanks,
dotnetcoder