Below is an SQL query that I generated using DatabaseExplorer
as well as a small sample of the result. How, att this point, can I perform analysis on the results of the query. For example how would I create a new variable that is equal to high - low
? And how would I graph high
?
In essence, I am having difficulty in having the result being used as actual data points.
SQLExecute[
SQLSelect[
"mySQLtry", {"both4"}, {SQLColumn[{"both4", "id"}],
SQLColumn[{"both4", "open"}], SQLColumn[{"both4", "high"}],
SQLColumn[{"both4", "low"}], SQLColumn[{"both4", "close"}],
SQLColumn[{"both4", "volume"}]}, None, "SortingColumns" -> None,
"MaxRows" -> 100000, "Timeout" -> 10, "Distinct" -> False,
"GetAsStrings" -> False, "ShowColumnHeadings" -> True]] // TableForm
{
{"id", "open", "high", "low", "close", "volume"},
{1, 167.29, 170.13, 166.93, 168.84, 6401800},
{2, 164.06, 167.28, 163.69, 166.7, 5996200},
{3, 164.5, 165.2, 163.21, 164.12, 5214800},
{4, 164.1, 165.71, 163.46, 163.76, 3586000},
{5, 164., 164.9, 163.31, 163.97, 1858100},
{6, 165.06, 165.8, 163.39, 163.63, 4052600},
{7, 165.5, 166.3, 164.5, 164.6, 4190700},
{8, 163.79, 166.75, 163.42, 165.45, 9392900},
{9, 161.81, 163.38, 160.2, 163.19, 8687100},
{10, 162.31, 163.62, 160.83, 160.93, 8943800},
{11, 163.85, 165.89, 163.07, 164.99, 8637700},
{12, 164.81, 166., 162.11, 162.74, 7539800},
{13, 166.48, 166.5, 163.86, 166.1, 6652900},
{14, 167.54, 167.95, 165.42, 166., 6425000},
{15
out
is your expression w/oTableForm
, thenEvaluate[Symbol /@ First@out] = Transpose@Rest@out
should work. This doesn't have anything to do with SQL queries though... $\endgroup$ – rm -rf♦ Mar 14 '15 at 16:10