data = Table[SQLSelect[conn, "All", {"col1", "col2"},
SQLColumn["col1"] == n && SQLColumn["col2"] == o], {n, 1, 8}, {o, 21,
30}];
This results in selecting the range of data in each column specified. What I'd really like to do is get a count of each value in col1 for each value in col2. As it is, I will get:
{1,21},{1,22},{1,23},{1,24},{1,25},{1,26},{2,27},{1,23}...
If I use the complete range of values I just cull col1 and col2 from my original table. What I have in mind is a table, per this example code, 8 rows x 9 columns that shows the count of all the times 1 and 21 appear together, then all the times 1 and 22 appear together up to 30, then how many times 2 and 21 appear and so on.
I want to end up with a table that looks something like this (row and column headers can be ignored):
21 22 23 24 25 26 27 28 29 30
1 1 1 2 7 12 30 47 80 91 112
2 1 1 3 12 18 48 59 118 133 151
and so on...
These SQL symbols are tricky in that they react strangely to variable manipulations.
Any suggestions would be appreciated.
Tally[]
$\endgroup$ – Dr. belisarius Mar 20 '14 at 19:20